Alpha/masking transparency does nothing in .b3d from gile[s]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
cowsarenotevil
Posts: 19
Joined: Fri Nov 18, 2005 4:14 pm

Alpha/masking transparency does nothing in .b3d from gile[s]

Post by cowsarenotevil »

So I have a level with trees in it that I made in tree[d] (from within gile[s]), and if I use masking or alpha testing the leaves look perfectly fine in gile[s], but when I export the level to a .b3d file, the transparent portion of the trees is opaque (they look like squares). The leaf texture is a .png.

I found this thread which would seem to suggest that there shouldn't be a problem, so I'm really at a loss for what to do.

Thanks a lot.
cowsarenotevil
Posts: 19
Joined: Fri Nov 18, 2005 4:14 pm

Post by cowsarenotevil »

Just as an update, I tried the my3d exporter that came with Irrlicht and the result was this:
Image
As you can see, the UV coordinates of the base texture and the lightmap are switched for some reason.

This is how it looks in gile[s] (how it's supposed to look) Image

but this is how it ends up looking when I export it as a .b3d and import it into Irrlicht (the original problem)
Image

Again, any help would be deeply appreciated.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

cowsarenotevil:

Hi,

I have giles now so I should be able to look at the problem better.

But it may just be that you are using a blend mode that I couldn't get in irrlicht.

do the .png leaf textures have an alpha layer, you can get irrlicht to use this (I forgot exactly which blend mode it is :oops: )

I can fix it up for you if you, post/ send me the .giles mesh (I won't steal it)
cowsarenotevil
Posts: 19
Joined: Fri Nov 18, 2005 4:14 pm

Post by cowsarenotevil »

Luke wrote:cowsarenotevil:

Hi,

I have giles now so I should be able to look at the problem better.

But it may just be that you are using a blend mode that I couldn't get in irrlicht.

do the .png leaf textures have an alpha layer, you can get irrlicht to use this (I forgot exactly which blend mode it is :oops: )

I can fix it up for you if you, post/ send me the .giles mesh (I won't steal it)
I was using both alpha testing (from the .png's alpha layer) and masking, but I tried it with just alpha testing as well (I don't think having both at once really does anything). I did try it setting the whole mesh (in Irrlicht) to EMT_TRANSPARENT_ALPHA_CHANNEL and the alpha testing worked, but the light maps didn't. I will send you the gile[s] mesh as soon as I can. Should I put it and all of the texture maps in a .zip file? I'm not totally sure what things I need to pack into the .gls file for it to work for you. I really appreciate your time.

This is just a silly n00b question, but it's another thing I was curious about: if I set the whole mesh to, say EMT_LIGHTMAP_M2 to make the lightmaps brighter, then it would set the entire mesh to that type, overriding any individual materials in the mesh, yes? If so, is there any way around this? Right now I'm not setting the material type in irrlicht at all (except when I set it to EMT_TRANSPARENT_ALPHA_CHANNEL and it apparently did override the lightmapping) for this reason.

Thanks again for your help.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Should I put it and all of the texture maps in a .zip file? I'm not totally sure what things I need to pack into the .gls file for it to work for you.
That should be fine.
This is just a silly n00b question, but it's another thing I was curious about: if I set the whole mesh to, say EMT_LIGHTMAP_M2 to make the lightmaps brighter, then it would set the entire mesh to that type, overriding any individual materials in the mesh, yes?
Yes it would overwrite the all individual materials in that mesh,

I think there is a setting in b3d files I use to get EMT_LIGHTMAP_M2, if not you can always loop though the materials on the mesh, and check if it is EMT_LIGHTMAP before setting it to EMT_LIGHTMAP_M2.
cowsarenotevil
Posts: 19
Joined: Fri Nov 18, 2005 4:14 pm

Post by cowsarenotevil »

Luke wrote:I think there is a setting in b3d files I use to get EMT_LIGHTMAP_M2, if not you can always loop though the materials on the mesh, and check if it is EMT_LIGHTMAP before setting it to EMT_LIGHTMAP_M2.
See, that's a clever idea that I'd never have thought of on my own (mainly because I didn't know that ISceneNode->getMaterial(s32 num) even existed until I found it just now). I could probably use that to loop through all of the materials until I get to the leaves and set them to EMT_TRANSPARENT_ALPHA_CHANNEL, too, couldn't I (although the lightmaps on the leaves wouldn't work)?

I'm uploading the map right now. Thanks again for your help.
Post Reply