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?
Alpha transparency of meshes with shaders in GL with 1.9SVN.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Alpha transparency of meshes with shaders in GL with 1.9
There have been changes, but no bug I know about.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Alpha transparency of meshes with shaders in GL with 1.9
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.
- 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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: Alpha transparency of meshes with shaders in GL with 1.9
Hi!
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.
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:
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
I will try changing the base material and try the other parameters you given me.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.
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.
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?
http://irrlicht.sourceforge.net/forum/v ... 4&start=90The 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.
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