Page 1 of 2

EMT_TRANSPARENT_ALPHA_CHANNEL Problem in V0.7

Posted: Tue Sep 14, 2004 9:31 am
by knightoflight
In the beginners-area yin nadie and skajake have the same problem like me. The material EMT_TRANSPARENT_ALPHA_CHANNEL (that now seems to be official) has a new bug:
1.:
the doc always said, that its not implemented and the doc still in V0.7 says:
...
EMT_TRANSPARENT_ALPHA_CHANNEL Makes the material transparent based on the texture alpha channel. Only first texture is used. Please note that this material is currenly NOT IMPLEMENTED. ...
But Niko wrote in the changes, that its in, so now i think its official and he only forgot to change the doc ?
2. DIRECTX: I use the material for billboards. The invisible parts of the billboard delete other billboards.
"Peter Müller" wrote that the problem is that they are rendered without the Z-Buffer ? How to change ?

Posted: Fri Sep 17, 2004 2:18 pm
by yin nadie
We-ell... I'm not completely sure we are talking about the same problem here. In order to explain myself better, here are two snapshots from one of my projects

http://www.ilogicgames.com/nadie/res/snap7.jpg
http://www.ilogicgames.com/nadie/res/snap8.jpg

The fist one is rendered using OpenGL. The objects using EMT_TRANSPARENT_ALPHA_CHANNEL are the red leaves and the snowflakes. The textures associated with these decals has 100% opaque areas (the leaf and the snowflake) and 100% transparent areas (the rest). According to the material description, the leaves should be opaque, but it can be noticed (althought it is easier to notice when the particles are moving) that both the leaves and the snowflakes aren't opaque, but transparent, proporcionally to their color.

In the second snapshot some other bugs about alpha channels can be noticed in the interface windows, but the problem with the EMT_TRANSPARENT... material is that neither the snowflakes nor the leaves are visible. Any object using this material dissapears from the rendered scene

Any ideas?

Posted: Fri Sep 17, 2004 2:48 pm
by jox
2 things that might help (or not):

1. EMT_TRANSPARENT_ALPHA_CHANNEL and OpenGL is not implemented properly in Irrlicht 0.7. It is fixed though in IrrlichtNX ( http://www.irrlichtnx.mmdevel.de )

2. With DirectX make sure 32 bit textures is activated when using EMT_TRANSPARENT_ALPHA_CHANNEL:

Code: Select all

driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);

Posted: Fri Sep 17, 2004 3:32 pm
by yin nadie
Foncing 32 bit textures in DirectX did correct the EMT_TRANS... material using decals, and also repaired some of the worst problems with the menus, but... for some reason the terrain mesh lost its texture *sigh*

I'll investigate some more (and try the irrlichtNX for OpenGL)

thanks, Jox

Posted: Fri Sep 17, 2004 3:53 pm
by bal
Maybe a bit offtopic but those screenshots look awesome :shock:. Very nice ground-detail and GUI.

Posted: Sat Sep 18, 2004 12:01 am
by yin nadie
Risking to drive this off topic, i'll say: lots of thanks, Bal; a lot of time and effort has been put on these. I'm happy knowing it does actually show

Now, let's resume our regular topic

Posted: Sat Sep 18, 2004 7:28 am
by jox
Sorry, but I must also say it looks pretty nice, very promising! :)

Posted: Sat Sep 18, 2004 8:38 am
by knightoflight
(btw: @yin nadie: yes the pics look cool, if its a gameproject, why dont you announce it it the project area to the community, please ?)

@jox: thanks, but when i change to 32-bit many other things dont work...
I think Niko should give as a patch or a bug-free version 0.7.1 or something before everyone uses IrrlichtNX and not Irrlicht. I didnt wanted to do, but in this way hes almost forces me to leave Irrlicht :-(

Posted: Sat Sep 18, 2004 10:54 am
by zola
knightoflight wrote:I think Niko should give as a patch or a bug-free version 0.7.1 or something before everyone uses IrrlichtNX and not Irrlicht. I didnt wanted to do, but in this way hes almost forces me to leave Irrlicht :-(
Hi let me assure You that you're NOT leaving Irrlicht if You're using the CVS version ;)

Posted: Sat Sep 18, 2004 11:41 pm
by yin nadie
PUSH temporary_thread_about_some_screenshots

I'll (actually we'll) post this project as soon as its webpage is finished. It shouldn't take more than ten or eleven days more (well, our web manager is a tad lazy - any extra delay will be his fault)

PULL temporary_thread_about_some_screenshots

I installed irrlichtNX (it took a while because my automake and autoconf versions were obsolete) an now everyting works just fine. I haven't tried it in Window$ yet, though

PS: i agree with zola: irrlichtNX is irrlicht, give or take a few patches (important patches, though) and the cvs... Oh, and the documentation is a lot nicer

Posted: Sun Sep 19, 2004 11:56 am
by Tyn
I am having the same problem as the UI in yin nadie's screenshot, the alpha colour was white and it does remove this white but it replaces it with black instead of making it transparent. I use driver->makeColorKeyTexture() to create the alpha, is this the same way you had the problem?

The problem occours in NX as well across all renderers, however the OpenGL driver also doesn't remove all the alpha colour. The same problem occoured across all renderers if I use setTextureCreationFlag(ETCF_ALWAYS_32_BIT,true).

Screenshot of the problem ( the cursor is the problem ).
http://www.tfh1.net/screenshot1.jpg

Posted: Sun Sep 19, 2004 12:02 pm
by yin nadie
Maybe it's the same problem, but it isn't the same procedure. In order to achieve different degrees of transparency in our gui, we used tga images with an alpha channel.

The makeColorKeyTexture function never failed me, but then, i never used it a lot because it didn't cover all my needs

Posted: Sun Sep 19, 2004 12:42 pm
by Tyn
It works out the same I think, as all the function does is change one colour to alpha, whereas tga already has an alpha channel inside the file.

Posted: Sun Sep 19, 2004 2:05 pm
by zola
Hi Tyn
Tyn wrote:I am having the same problem as the UI in yin nadie's screenshot, the alpha colour was white and it does remove this white but it replaces it with black instead of making it transparent. I use driver->makeColorKeyTexture() to create the alpha, is this the same way you had the problem?

The problem occours in NX as well across all renderers, however the OpenGL driver also doesn't remove all the alpha colour. The same problem occoured across all renderers if I use setTextureCreationFlag(ETCF_ALWAYS_32_BIT,true).

Interesting.

Could You post a little test app where I could reproduce this error, and could You please post a texture You use and have this error with too?

Thanks

Posted: Sun Sep 19, 2004 3:11 pm
by Tyn
Yeah, sure.

http://www.tfh1.net/alphatest.zip

It contains the image, a simple program that displays the bug and the code I used to create the program. If you compile yourself you will have to use your own DLL file as I used a modified NX engine.