Mesh transparency

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!

Mesh transparency

Postby mant » Wed Aug 16, 2017 8:31 am

I created new GLSL material and its base type is TRANSPARENT_VERTEX_ALPHA.
But calling IMeshManipulator::setVertexColorAlpha(IAnimatedMesh*, value) doesn't change it's opacity.
Do I have to change something else?
mant
 
Posts: 85
Joined: Sun Jan 27, 2013 3:38 pm

Re: Mesh transparency

Postby CuteAlien » Wed Aug 16, 2017 9:42 am

Are you using the vertex color in your shader? The way you do that depends on if you work with OGL ES2 or with OpenGL. In ES2 Irrlicht passes on the variable "inVertexColor". In OpenGL I'm not certain right now (I have no example for that...), but it's probably called gl_Color.
You pass that on the pixel-shader with a varying variable and use it to calculate the final color there.
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8533
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Mesh transparency

Postby mant » Wed Aug 30, 2017 9:56 pm

I haven't come back to this, will try to update as soon as possible.
mant
 
Posts: 85
Joined: Sun Jan 27, 2013 3:38 pm


Return to Advanced Help

Who is online

Users browsing this forum: No registered users and 1 guest