problem changing alpha value from 255 to 0

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
selles
Posts: 8
Joined: Sun Jul 03, 2005 9:21 pm

problem changing alpha value from 255 to 0

Post 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!
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

EMT_TRANSPARENT_ALPHA_CHANNEL only uses the alpha channel from the texture. Material color alpha and vertex color alpha are ignored :(
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

But there is EMT_TRANSPARENT_VERTEX_ALPHA which takes the vertex color's alpha value.
selles
Posts: 8
Joined: Sun Jul 03, 2005 9:21 pm

Post by selles »

Thank you peoples,

with EMT_TRANSPARENT_VERTEX_ALPHA this works perfectly !! 8)

you are too much, Thank you :D
Post Reply