Transparency

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
Stain

Transparency

Post 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?
Ishtm
Posts: 37
Joined: Mon May 09, 2005 8:03 pm

Post 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
Stain

Post 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.)
squisher
Competition winner
Posts: 91
Joined: Sat May 17, 2008 2:23 am
Contact:

Post by squisher »

bump. help.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

screenshots please. just because...
Image
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

quickfix: use opengl not d3d
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Flip normals 8)
Do you like VODKA???
Image
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Normals have nothing to do with this problem :lol:
Image Image Image
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Just wanted to say something :wink:
Do you like VODKA???
Image
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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!
Image Image Image
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post 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.
Do you like VODKA???
Image
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Normals are only used for lighting so they're not going to affect z-order at all.
Image Image Image
Post Reply