Alpha channel

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
lincsimp
Posts: 21
Joined: Sat Mar 12, 2005 10:11 pm

Alpha channel

Post by lincsimp »

Hi
In the custom scene node tutorial the vertices are defined like this:

Vertices[0] = video::S3DVertex(0,0,10, 1,1,0, video::SColor(255,0,255,255), 0, 1);

If the values in the alpha channel are changed nothing happens, so it it necessary here? If it is not necessary shouldn't there be an SColor construcor like this SColor(f32 r, f32 g, f32 b) ? Could a 24 bit format be used?

I'm new here so I don't really know...

Cheers
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Try change the code to

Code: Select all

SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT)
and then transparency will work i suppose... Not tested though.
lincsimp
Posts: 21
Joined: Sat Mar 12, 2005 10:11 pm

Post by lincsimp »

Ok thanks, now I've got:

Code: Select all

Vertices[0] = video::S3DVertex(0,0,10, 1,1,0, video::SColor(0,0,255,255), 0, 1);
		Vertices[1] = video::S3DVertex(10,0,-10, 1,0,0, video::SColor(0,255,0,255), 1, 1);
		Vertices[2] = video::S3DVertex(0,20,0, 0,1,1, video::SColor(0,255,255,0), 1, 0);
		Vertices[3] = video::S3DVertex(-10,0,-10, 0,0,1, video::SColor(0,0,255,0), 0, 0);
		 SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT) ;
Unfortunately it hasn't changed, what've I done wrong?

Cheers
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I'm pretty sure this works:
setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
lincsimp
Posts: 21
Joined: Sat Mar 12, 2005 10:11 pm

Post by lincsimp »

Thanks!

To test I set all of the alpha values to 0, should this make the object transparent?

cheers
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Hm, i think that drawIndexedTriangleList is not able to draw transparent objects...
Post Reply