EMT_TRANSPARENT_VERTEX_ALPHA
EMT_TRANSPARENT_VERTEX_ALPHA
I've been fooling around with the OBJ loader and shaders and I found some weird behaviour. That is, I set the colour in the pixel shader to a flat colour, well, white. But my object, a cube, has black artifacts. I think this is due to the base material being EMT_TRANSPARENT_VERTEX_ALPHA. Looking at the code, it sets blending, which is OK, but it also sets other stuff in the texture environment that I don't understand but that I guess is related to multi-texturing.
My point. I'm trying to control the output using a shader but I get these side effects. I suppose I could change to EMT_ONETEXTURE_BLEND but I really don't see why the other code is in Irrlicht. After all, Doom3 came out in 2004 and I don't think it does any multitexturing. In fact, I think 4 texture units have been available for a very long time.
In summary, do we really need that texture environment code or does it truly belong to another time?
My point. I'm trying to control the output using a shader but I get these side effects. I suppose I could change to EMT_ONETEXTURE_BLEND but I really don't see why the other code is in Irrlicht. After all, Doom3 came out in 2004 and I don't think it does any multitexturing. In fact, I think 4 texture units have been available for a very long time.
In summary, do we really need that texture environment code or does it truly belong to another time?
Re: EMT_TRANSPARENT_VERTEX_ALPHA
This is fixed in trunk (OGL driver).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: EMT_TRANSPARENT_VERTEX_ALPHA
OK, thanks. Do we have a date for the release of 1.9?
Re: EMT_TRANSPARENT_VERTEX_ALPHA
Sorry, but not yet. We had plan for release v1.9 in summer, but due to lack of time we must delay this release for some months.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: EMT_TRANSPARENT_VERTEX_ALPHA
Summer is still 5 weeks away
Re: EMT_TRANSPARENT_VERTEX_ALPHA
Can you link the commit?
Re: EMT_TRANSPARENT_VERTEX_ALPHA
This is initial commit:
http://sourceforge.net/p/irrlicht/code/4403/
in the next commits we slightly improved some things related to this stuff. At now I see a bug in trunk with grab/drop base material (missing drop in destructor).
Anyway I think that the best solution for base material is available in COGLES2Driver and I'll implement it in standard OGL. At now I'm finishing my game, so in upcoming days I'll have more free time for irr dev, so I'll be able to send some fixes on the repo.
http://sourceforge.net/p/irrlicht/code/4403/
in the next commits we slightly improved some things related to this stuff. At now I see a bug in trunk with grab/drop base material (missing drop in destructor).
Anyway I think that the best solution for base material is available in COGLES2Driver and I'll implement it in standard OGL. At now I'm finishing my game, so in upcoming days I'll have more free time for irr dev, so I'll be able to send some fixes on the repo.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: EMT_TRANSPARENT_VERTEX_ALPHA
This works, but the comments in IMaterialRendererServices.h are now out of date.
Re: EMT_TRANSPARENT_VERTEX_ALPHA
Thanks, I'll fix comments after apply these changes into D3D9 driver.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: EMT_TRANSPARENT_VERTEX_ALPHA
In the latest trunk OpenGL handles base material in the same way as OpenGL ES2.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: EMT_TRANSPARENT_VERTEX_ALPHA
I'm wondering about the texture_env_combine code in COpenGLMaterialRenderer.h. I have a simple setup, one transparent object in front of another. In the simplest case, one object is white and the other one is black. The black object appears black when in front/behind the white one (there is no ordering of transparent objects). But using (SRC_ALPHA, ONE_MINUS_SRC_ALPHA) you would expect, say, white*0.5 + black*0.5. So I thought I'd try some experiments in the shader.
Colour = (1, 1, 1, 1) both objects are white, even though background is black!
Colour = (1, 1, 1, 0.5) neither object appears in front of the black background.
Colour = (.5, .5, .5, 1) both objects appear with colour (.5, .5, .5).
Colour = (.5, .5, .5, .5) neither object appears in front of the black background.
It looks as if we are modulating and not blending!
BTW Material.DiffuseColor is (.8, .8, .8 ) though it shouldn't have any effect. There is a white texture bound to Unit 0 and a grey texture bound to Unit 1. Textures are also bound to Units 2 and 3.
Though I believe that texture_env_combine is used in terrain rendering, there is no such example in the Irrlicht code. The only appearance of the transparent modes is in the per-pixel lighting example and the material renderer example. I think that TRANSPARENT_VERTEX_ALPHA may need the combiner in order to use the vertex alpha, though the OBJ loader actually sets alpha in the Material.DiffuseColor and not the vertex colour.
tl;dr I think Irrlicht doesn't allow more than one transparent (occluding) object.
Colour = (1, 1, 1, 1) both objects are white, even though background is black!
Colour = (1, 1, 1, 0.5) neither object appears in front of the black background.
Colour = (.5, .5, .5, 1) both objects appear with colour (.5, .5, .5).
Colour = (.5, .5, .5, .5) neither object appears in front of the black background.
It looks as if we are modulating and not blending!
BTW Material.DiffuseColor is (.8, .8, .8 ) though it shouldn't have any effect. There is a white texture bound to Unit 0 and a grey texture bound to Unit 1. Textures are also bound to Units 2 and 3.
Though I believe that texture_env_combine is used in terrain rendering, there is no such example in the Irrlicht code. The only appearance of the transparent modes is in the per-pixel lighting example and the material renderer example. I think that TRANSPARENT_VERTEX_ALPHA may need the combiner in order to use the vertex alpha, though the OBJ loader actually sets alpha in the Material.DiffuseColor and not the vertex colour.
tl;dr I think Irrlicht doesn't allow more than one transparent (occluding) object.