billboard behind transparent billboard

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
skajake
Posts: 9
Joined: Sun Sep 12, 2004 6:26 pm

billboard behind transparent billboard

Post by skajake »

I have 2 billboards, one behind the other. The first one is a crosshairs that has a transparency. The second is a bullet fired from the gun. The bullet billboard does not show throught the transparency of the crosshair. When I fire, then move the crosshair to the side, the bullet shows. Otherwise, the crosshair transparency works fine with the level mesh. Any ideas?

crosshair:

Code: Select all

bill = smgr->addBillboardSceneNode(camera);
bill->setPosition(vector3df(0,0,2));
bill->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL );
bill->setMaterialFlag(video::EMF_LIGHTING, false);
bill->setSize(core::dimension2d<f32>(0.21f, 0.21f));
ITexture * texture = driver->getTexture((dir + "cross.bmp").c_str());
driver->makeColorKeyTexture(texture, SColor(255,0,0,0)); 
bill->setMaterialTexture(0, texture);
bullet node that is fired from the gun:

Code: Select all

node= smgr->addBillboardSceneNode(0,core::dimension2d<f32>(25,25), start);
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setMaterialTexture(0, device->getVideoDriver()->getTexture((dir + "fireball.bmp").c_str()));
node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
[/code]
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

Transparend nodes will be rendered without the z buffer.
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
skajake
Posts: 9
Joined: Sun Sep 12, 2004 6:26 pm

Post by skajake »

Is there a workaround for this issue? Perhaps using a model for the crosshairs?

EDIT: Recompiling in OPENGL fixed this issue.
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

Hi Skajake,
i opened a thread in "Bug Report" for this, you say only recompiling the engine kills the bug ? No changes in the engine only recompiling ?
skajake
Posts: 9
Joined: Sun Sep 12, 2004 6:26 pm

Post by skajake »

Actually, the problem was occuring under DirectX8, recompiling in OpenGL solved the issue. So must be a bug anyways.
knightoflight
Posts: 199
Joined: Sun Aug 24, 2003 5:47 pm
Location: Germany

Post by knightoflight »

you mean you switched in the createDevice to OPENGL. Then the bug isnt away, you only worked around and use OPENGL.
Post Reply