Page 1 of 1

Irrlich shader handling transparency

Posted: Sun Dec 28, 2014 10:08 am
by robmar
Anyone got am HLSL or GLSL version of the Irrlicht standard transparency shader function, or is it fixed pipeline?

When I use alpha transparency on models it works, but there are lines visible in the transparent area that do not appear with the Irrlicht default transparent shader selection.

Re: Irrlich shader handling transparency

Posted: Sun Dec 28, 2014 1:47 pm
by mongoose7
Irrlicht has no "transparent" shader, it sets the OpenGL/DX state. See Example 10.

Re: Irrlich shader handling transparency

Posted: Mon Dec 29, 2014 3:13 am
by robmar
So this is the default pipe state, that also handles a light reflection?

Re: Irrlich shader handling transparency

Posted: Mon Dec 29, 2014 8:28 am
by mongoose7
The OpenGL state is not restricted to the fixed-function pipeline. If you set blending (glEnable(GL_BLEND)) and configure the blend function, whatever you then render will be blended with the render target. Regardless if you use shaders or fixed-function. Light reflection is a separate matter and I didn't think Irrlicht handled it. Maybe this is not what you meant, though, as I'm sure you have to handle reflection yourself.

Re: Irrlich shader handling transparency

Posted: Mon Dec 29, 2014 10:06 am
by robmar
I guess that explains it. If I use my shader with alpha, the light reflections also get reduced because they are part of the RGB that gets alpha´d.

If I use a glass shader, then I have the overhead of rendering that part of the scene to a texture, and blending in the shader.

I guess there is no low-cost way to add reflections to the transparency.

Re: Irrlich shader handling transparency

Posted: Mon Dec 29, 2014 4:18 pm
by mongoose7
Just render the node twice.