Page 1 of 1

problem changing alpha value from 255 to 0

Posted: Mon May 01, 2006 3:25 am
by selles
Hi peoples, :)

I'm using the Irrlicht 1.0 version..

My problem is to vary gradually of the solid for the transparent using EMT_TRANSPARENT_ALPHA_CHANNEL..

my code is...

Code: Select all


   //  ...
    tapaTela=cena->addAnimatedMeshSceneNode(cena->getMesh("media/blkBox.3DS"),
         cameraNodo,-1,vector3df(0.0f,0.0f,0.0f));

tapaTela->getMaterial(0).MaterialTypeParam=0.01f;         tapaTela->getMaterial(0).MaterialType=EMT_TRANSPARENT_ALPHA_CHANNEL ;

tapaTela->getMaterial(0).DiffuseColor.set(255,0,0,0);


//...


some threads about the subject already exist but it seems that didn't get a solution

well.. I know that, for default, this is just configured to renderize pixels with alpha larger than 127 and that can alter that through MaterialTypeParam
but I already tried one milion of values for the MaterialTypeParam the ref doesn't change (0.01f, 1.0f, ..255.0f)

the documentation explaine just that If MaterialTypeParam is set to 0, the alpha ref gets its default value which is 0.5f and which means that pixels with an alpha value >127 will be written..but the documentation doesn't say what happens for other MaterialTypeParam values :( , could negative values be?

therefore, I felt the need to create that topic and to beat again in this key

does anybody can me to explain the one what it happens? can it have a context in what that it doesn't work?

Thank you!

Posted: Mon May 01, 2006 7:01 am
by Klasker
EMT_TRANSPARENT_ALPHA_CHANNEL only uses the alpha channel from the texture. Material color alpha and vertex color alpha are ignored :(

Posted: Mon May 01, 2006 9:41 am
by hybrid
But there is EMT_TRANSPARENT_VERTEX_ALPHA which takes the vertex color's alpha value.

Posted: Wed May 03, 2006 5:15 am
by selles
Thank you peoples,

with EMT_TRANSPARENT_VERTEX_ALPHA this works perfectly !! 8)

you are too much, Thank you :D