Irrlich shader handling 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
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Irrlich shader handling transparency

Post 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.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlich shader handling transparency

Post by mongoose7 »

Irrlicht has no "transparent" shader, it sets the OpenGL/DX state. See Example 10.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Irrlich shader handling transparency

Post by robmar »

So this is the default pipe state, that also handles a light reflection?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlich shader handling transparency

Post 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.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Irrlich shader handling transparency

Post 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.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlich shader handling transparency

Post by mongoose7 »

Just render the node twice.
Post Reply