I want to display player names over their meshes, but the name should be 'correctly' hidden by other objects, smoke etc.
Since overlays are drawn last and thus are not occluded I decided to adapt cTh's MoveableText class. So far it works fine with my modifications (ie constant text size), but whatever I try the text is not occluded by transparent particle effects (like smoke).
I explicitly set:
depthcheck on ( to be occluded by objects )
lighting off
depth write off
and blending to SOURCE_ALPHA, ONE_MINUS_SOURCE_ALPHA
Material::isTransparent() reports true, so it should be sorted by depth against the particle (sytem) before drawing, yet it is always drawn over the smoke in the foreground. What did I miss?
(still using 0.15.2 if that matters)
MovableText always overdraws particle smoke? SOLVED
-
iq
- Greenskin
- Posts: 125
- Joined: Mon Oct 20, 2003 8:25 pm
MovableText always overdraws particle smoke? SOLVED
Last edited by iq on Sat Feb 19, 2005 9:23 pm, edited 1 time in total.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
-
iq
- Greenskin
- Posts: 125
- Joined: Mon Oct 20, 2003 8:25 pm
No, unfortunatly not.
The particle system and the text are attached to two different nodes. Since the BB of the text does not get transformed I created a small fixed BB for the renderable centered on the node.
If I show the BB and the scene nodes debug arrows then these are properly rendered behind the smoke, just not the text.
I have already added the MovableText class to the smoke demo and it displays the same behaviour, so it is no side effect of my app... (although for some strange reasons it doesn't like to render the node arrows properly there)
/me scratches head
The particle system and the text are attached to two different nodes. Since the BB of the text does not get transformed I created a small fixed BB for the renderable centered on the node.
If I show the BB and the scene nodes debug arrows then these are properly rendered behind the smoke, just not the text.
I have already added the MovableText class to the smoke demo and it displays the same behaviour, so it is no side effect of my app... (although for some strange reasons it doesn't like to render the node arrows properly there)
/me scratches head
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
-
iq
- Greenskin
- Posts: 125
- Joined: Mon Oct 20, 2003 8:25 pm
I already had checked render queues, as I mess with them in my program (this was the main reason I integrated the class in the smoke demo).
I was about to clean up my current code to post it here when it hit me while I was reformating the header file:
getSquaredViewDepth was returning 0 instead of something sensible
no wonder sorting was wrong...
Serves me right for being lazy and copying code instead of writing it myself
I was about to clean up my current code to post it here when it hit me while I was reformating the header file:
getSquaredViewDepth was returning 0 instead of something sensible
no wonder sorting was wrong...
Serves me right for being lazy and copying code instead of writing it myself