Texts are visible trought the walls

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Texts are visible trought the walls

Post by Mancuso Raffaele »

I need that the texts aren't visible trought the walls! how to do this?? I try with:

Code: Select all

collides_obj[i].text->setMaterialFlag(video::EMF_ZBUFFER,true);
collides_obj[i].text->setMaterialFlag(video::EMF_ZWRITE_ENABLE,true);
but not happens!! thanks.

Image
Bye all,
Mancuso Raffaele (Ares FPS game)
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You'll have to stop using addTextSceneNode. The existing version draws the text to the screen at the appropriate 2d position. It does not take object occlusion into account.
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Post by Mancuso Raffaele »

You'll have to stop using addTextSceneNode. The existing version draws the text to the screen at the appropriate 2d position. It does not take object occlusion into account.
so.......how to make text invisible trought the walls?
Bye all,
Mancuso Raffaele (Ares FPS game)
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

I've made something similar using billboards.
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Post by Mancuso Raffaele »

I've made something similar using billboards.
but I use text to show life,armour and munitions. For life and armour I "just" create 100 image file (because life is between 0 and 100), but the munitinos can be 9999999999999. So? Is there noway to enable zbuffer test on a text scene node?
Bye all,
Mancuso Raffaele (Ares FPS game)
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Mancuso Raffaele wrote:
I've made something similar using billboards.
but I use text to show life,armour and munitions. For life and armour I "just" create 100 image file (because life is between 0 and 100), but the munitinos can be 9999999999999. So? Is there noway to enable zbuffer test on a text scene node?
Uhm i have damage numbers using billboards. Do you think i have made 999 numbers? Hehe, i've just done numbers from 0 to 9 and a fuction to join several images into just one using IImage to ITexture.

Btw, i have not used texts, so i don't know about disabling zbuffer for them. Sorry.
Mikenoworth
Posts: 78
Joined: Sat May 27, 2006 9:24 pm
Location: Logan, UT

Post by Mikenoworth »

I'm not sure but you can try to use render to texture to use your basic fonts to make a texture for the billboards.

Look in the forums for topics on rendering to textures, or check Irrlichts help file.
Stout Beer
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Post by Mancuso Raffaele »

Bye all,
Mancuso Raffaele (Ares FPS game)
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Keep the text scenenode!

You probably already have a ray/vector joining that enemy with that text scenode, test it for collision with te level if collision is true.

textscenenode>setVisible(false);
Post Reply