wrong draw order when using EMT_TRANSPARENT_ALPHA_CHANNEL
Posted: Mon Jul 19, 2010 5:16 am
I've seen several references to this issue around the forums but no definitive solution and the suggestions I found didn't work for me.
I'm using a simple custom scene node very similar to tutorial 3 to draw textures in 3d space. Basically, it's my own billboard scene node. The textures are pngs with an alpha channel. I set the material type to EMT_TRANSPARENT_ALPHA_CHANNEL which makes the textures look perfect, but I then realized that the draw order is somehow messed up in that more distant objects are drawn over top of closer objects.
Using EMT_TRANSPARENT_ALPHA_CHANNEL_REF does fix this problem but of course the textures lose the smooth, anti-aliased transition from opaque to transparent which is not desirable for my game's artwork. Other suggestions like setting EMF_ZWRITE_ENABLE to true did not fix the problem.
Is there a solution to the draw order issue when using EMT_TRANSPARENT_ALPHA_CHANNEL?
I'm using opengl and irrlicht 1.6.
Cheers.
I'm using a simple custom scene node very similar to tutorial 3 to draw textures in 3d space. Basically, it's my own billboard scene node. The textures are pngs with an alpha channel. I set the material type to EMT_TRANSPARENT_ALPHA_CHANNEL which makes the textures look perfect, but I then realized that the draw order is somehow messed up in that more distant objects are drawn over top of closer objects.
Using EMT_TRANSPARENT_ALPHA_CHANNEL_REF does fix this problem but of course the textures lose the smooth, anti-aliased transition from opaque to transparent which is not desirable for my game's artwork. Other suggestions like setting EMF_ZWRITE_ENABLE to true did not fix the problem.
Is there a solution to the draw order issue when using EMT_TRANSPARENT_ALPHA_CHANNEL?
I'm using opengl and irrlicht 1.6.
Cheers.