MovableText always overdraws particle smoke? SOLVED

Problems building or running the engine, queries about how to use features etc.
Post Reply
iq
Greenskin
Posts: 125
Joined: Mon Oct 20, 2003 8:25 pm

MovableText always overdraws particle smoke? SOLVED

Post by iq »

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)
Last edited by iq on Sat Feb 19, 2005 9:23 pm, edited 1 time in total.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

The sorting is done based on the centre, perhaps that's the issue.
iq
Greenskin
Posts: 125
Joined: Mon Oct 20, 2003 8:25 pm

Post by iq »

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
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Perhaps MovableText has a later default render queue? Since this is a user class I'm not sure what exactly it does, but given the general reason for it it would seem sensible for it to have default settings that made it appear on top of everything else.
iq
Greenskin
Posts: 125
Joined: Mon Oct 20, 2003 8:25 pm

Post by iq »

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 :oops:
no wonder sorting was wrong...

Serves me right for being lazy and copying code instead of writing it myself ;)
Post Reply