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!
Post Reply
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Mesh transparency

Post by mant »

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?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Mesh transparency

Post by CuteAlien »

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.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Mesh transparency

Post by mant »

I haven't come back to this, will try to update as soon as possible.
Post Reply