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

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

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

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

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

Post by CuteAlien »

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
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

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

Post 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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
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

Post 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
Post Reply