Z-writing wrongly enabled for transparent shader materials

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

Re: Z-writing wrongly enabled for transparent shader materia

Post by Nadro »

Ad1. Maybe instead of "force blending" mechanism we should add new EBO value like EBO_AUTOMATIC (it will be default instead of EBO_NONE). This value will inform that engine shouldn't change EBO per SMaterial, but it should use blending values stored in material renderer.

Ad2. I'll check it again tomorrow.

BTW. To fix isTransparent method we have to check blending operation + blending function values, however i'm not sure if we shouldn't add field (with default value set to AUTO) to SMaterial to give the user control to force reqister for solid or transparent pass process. Automatic mechanism will be not working properly in each situation.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
CuteAlien
Admin
Posts: 9651
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Z-writing wrongly enabled for transparent shader materia

Post by CuteAlien »

Uff, I really should spend more time on figuring this out, but I'm in deep-panic-mode already in my current project, so I can't...
Just try to get away with minimal changes you need for the fix and don't try fixing 2 problems at the same time. EBO_AUTOMATIC might be a good idea - I can't tell without getting deeper into this. Be careful not to change the value of the existing enums - you can only add new enums with new values or you break any kind of serialization anyone used on materials (some people have big material-databases and it would be nice not to break those).
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: Z-writing wrongly enabled for transparent shader materia

Post by Nadro »

Thanks for the hint about enums + serialization, I forgot about it :P (probably, because i never use Irrlicht serialization).

Today I'll try to push commit related to something like an EBO_AUTOMATIC.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Z-writing wrongly enabled for transparent shader materia

Post by Nadro »

I sent commit with changes to trunk.
- Force blending mechanism was removed.
- I didn't add EBO_AUTOMATIC, just improved comment for E_BLEND_OPERATION, because original was wrong.

First implementation with EBO_NONE was properly. Bug existed in other place - wrong base material handling by material renderer (calls order). It's already fixed. Tomorrow I'll add commit related to blend function call per SMaterial.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Z-writing wrongly enabled for transparent shader materia

Post by Nadro »

Separate blending support is available in trunk. In last commit I added BlendFactor to SMaterial too. At now EMT_ONETEXTURE_BLEND should be signed as deprecated for all shader based materials. All tasks related to this discussion are finished.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply