Page 1 of 1

Alpha transparency of meshes with shaders in GL with 1.9SVN.

Posted: Sun May 31, 2015 4:26 am
by christianclavet
Hi, Perhaps I'm posting for nothing. But we've seen something happening with transparency that affect rendering in Irrlicht.

Lately on XEFFECT on GL, we discovered something that Irrlicht does improperly with alpha information from shaders.
Do we have to write the shaders or handler differently or it's something that being worked? Seen another information about SPARK than mention they also have problem with transparency.

Is it a known issue?

Re: Alpha transparency of meshes with shaders in GL with 1.9

Posted: Sun May 31, 2015 9:14 am
by CuteAlien
There have been changes, but no bug I know about.

Re: Alpha transparency of meshes with shaders in GL with 1.9

Posted: Mon Jun 01, 2015 10:55 am
by Nadro
This is the best solution to handle alpha + shaders with Irrlicht from SVN:
- Use standard SOLID material as a base material.
- Set SMaterial::BlendOperation to EBO_ADD;
- Set SMaterial::BlendFactor to pack_textureBlendFunc(EBF_SRC_ALPHA, EBF_ONE_MINUS_SRC_ALPHA);
With this solution you don't need separate materialType for solid and transparent shaders, you can just change SMaterial::BlendFactor, however old solution should works too.

Re: Alpha transparency of meshes with shaders in GL with 1.9

Posted: Mon Jun 01, 2015 12:47 pm
by christianclavet
Hi!
With this solution you don't need separate materialType for solid and transparent shaders, you can just change SMaterial::BlendFactor, however old solution should works too.
I will try changing the base material and try the other parameters you given me.

XEffect on GL give problems in rendering since 1.8+ with transparency. There reports that it work correctly under DX9.

Here is a render in IRB with a object that contain transparency and is rendered with XEffect (Trunk SVN on GL). If you look attentively, the shadow mass is absent and the shadow border are not clipped. If the object don't have any transparency, the rendering is fine. I think it rendered fine before 1.8.
Image
The old method (transparency from shader seem to fail here), one user thing this might have to do the way the shader is doing the material depth.
http://irrlicht.sourceforge.net/forum/v ... &start=780

Seen this on the SPARK thread:
Has spark been updated to work with irrlicht 1.8?
The only part of SPARK that uses Irrlicht are SPK::IRR::Renderers, and they work with the latest SVN version of Irrlicht. There is still one or two graphic bugs related to transparency, but at least for once it is an Irrlicht bug.
http://irrlicht.sourceforge.net/forum/v ... 4&start=90

Can you check if the old method still work?
Here is the source I'm using from XEffects in IRB (work with Irr 1.9 SVN, but have transparency issues in GL since Irr 1.8+), just start a simple project with this and check what happen when you use a transparent/alpha object. Got report that nothing is wrong when using directx 9.0. This only fail like this, when using objects with alpha transparency on openGL. So for some reason the "old method" is not working.
http://irrrpgbuilder.sourceforge.net/files/XEffects.zip