Page 1 of 1

Transparency

Posted: Tue Oct 11, 2005 1:33 pm
by Stain
Hi guys!

I'm new to Irrlicht (actually I'm using Irrlicht.Net) and I came across a problem with making a model transparent. I add 3ds textured model, a camera and one or several lights to the scene: everything renders fine. But when I change material type for that model to TRANSPARENT_VERTEX_ALPHA the model is rendered incorrectly: far faces are sometimes rendered on top of nearer ones. It looks like no alpa-sorting is performed.
What shall I do to get a single model rendered correctly with transparency?

Posted: Tue Oct 11, 2005 6:12 pm
by Ishtm
May by you can't setting correct flags for material,
try put true on these material flags:

ZwriteEnable
ZBuffer
BackFaceCulling

that makes zorder work, but another thing is needed to use TransparentVertexAlpha:

when you create mesh you have to set the alpha value of vertex color less than 1.0 to get some transparency

Posted: Sun Oct 16, 2005 3:51 pm
by Stain
Thanks for advice, but it didn't work.

TRANSPARENT_VERTEX_ALPHA doesn't work properly with any combination of material flags (zbuffer, zwritesenabled, backfaceculling, lighting, and all others). I spent two days playing with all these options and material colors with no result.

I've managed to get transparent model by using TRANSPARENT_ADD_COLOR material type. It works fine but this option mixes material color with texture color and I need pure texture color. I guess, TRANSPARENT_VERTEX_ALPHA should do this but it doesn't work for me. So the question is still open: how can I render model with alpha but without material color blended to texture?

(I use Irrlicht 0.12 with DX9 driver on DirectX 9.0c from Aug 2005 DX SDK update.)

Posted: Wed Sep 10, 2008 9:49 pm
by squisher
bump. help.

Posted: Thu Sep 11, 2008 1:46 am
by dlangdev
screenshots please. just because...

Posted: Thu Sep 11, 2008 3:40 am
by jontan6
quickfix: use opengl not d3d

Posted: Thu Sep 11, 2008 8:16 am
by Bear_130278
Flip normals 8)

Posted: Thu Sep 11, 2008 8:21 am
by JP
Normals have nothing to do with this problem :lol:

Posted: Thu Sep 11, 2008 11:40 am
by Bear_130278
Just wanted to say something :wink:

Posted: Thu Sep 11, 2008 11:50 am
by JP
Best not to if you don't know what you're talking about because you'll just confuse people... it's not a contest to see who can post most!

Posted: Thu Sep 11, 2008 12:25 pm
by Bear_130278
JP, you are not in the mood today?
My idea based on own experience.
Sometimes when exporting meshes in .x format i received very similar problems with incorrect polygon placement, but it was only visual illusion because of incorrect normal directions.

Posted: Thu Sep 11, 2008 12:53 pm
by JP
Normals are only used for lighting so they're not going to affect z-order at all.