setting transparency billboard scenenode

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
Roman B.
Posts: 9
Joined: Wed Mar 10, 2010 8:04 am
Location: Russia
Contact:

setting transparency billboard scenenode

Post by Roman B. »

Sorry for my english, I speak it so so. :oops:

I can't understand, how make billboard dynamic "disappearance" through setting transparency.

This is my code:

Code: Select all

		slidenode = smgr->addBillboardSceneNode(0, core::dimension2d<f32>(1920, 1371),core::vector3df(0,70,950));
		slidenode->setMaterialFlag(video::EMF_LIGHTING, false);
		//slidenode->setMaterialType(video::EMT_SOLID);
		slidenode->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
		slidenode->setMaterialTexture(0,slide[tourindex][slideindex]);
video::EMT_TRANSPARENT_ADD_COLOR - make my billboard transparent, but how i can make level of transparency?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you use ADD_COLOR, you have to change the pixel values towards black. Quite similar is ALPHA_CHANNEL, where you have to change the alpha values towards 0. With VERTEX_ALPHA you only need to change the vertex color's alpha vlaues towards zero, which is only 4 values usually. However, it's hard to combine these transparency settings. You could try and use the alpha channel and the alpha threshold if you have your alpha channel built up as a gradient. Or try with the ONE_TEXTURE_BLEND material, which offers multiple transparency settings.
Roman B.
Posts: 9
Joined: Wed Mar 10, 2010 8:04 am
Location: Russia
Contact:

Post by Roman B. »

hybrid, thank you for your answer. But i still can't understand how do this :oops:

If i try ONE_TEXTURE_BLEND, how i can set transparency of the billboard?

When I set material to ONE_TEXTURE_BLEND, there is only black screen instead of image.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

For one_texture_blend you need to call the method pack_texureBlendFunc, which takes all the necessary input for this material. The alpha source is the last parameter. There you can store whether to use vertex alpha or texture alpha, or both.
anchor
Posts: 9
Joined: Thu Jun 25, 2009 2:57 pm
Location: Hungary

transparency with vertex alpha

Post by anchor »

i have same problem. i need transparent textured mesh, with vertex alpha change. its not impossible, because the particle system can do it.
i solved it with own shader, but i would happy with a solution without any shader. hybrid! can you write the exact setting for that?
Roman B.
Posts: 9
Joined: Wed Mar 10, 2010 8:04 am
Location: Russia
Contact:

Post by Roman B. »

Still can't make smooth disappearance of billboardscenenode.

I am using OpetGL render type and have a such scenenode:

Code: Select all

ISceneNode* slidenode;
ITexture** slide;
...
...
slidenode = smgr->addBillboardSceneNode(0, core::dimension2d<f32>(1650, 900),core::vector3df(0,5,950));
slidenode->setMaterialTexture(0,slide[slideindex]);
Result:

Image

I I tried use transparency, but all my attempts have failed :(

Have somebody any idea, how to make smooth disappearance of billboardscenenode.
Post Reply