View Full Version : 2D text + deth testing

01-17-2010, 01:27 PM
Hello, I'm writing a game, and I found some ( not so big ) problem.

I have a players on the scene and I'm trying to print theyrs nick. So I just use gluUnproject and I'm recieving a 2D window position of 3D point.

My question: how to use a depth buffer ( using pipe line , dunno maybe some matrix tricks ), to when I'm printing a text. Becaouse now I'm using a Orthogonal mode, when the far and near planes are the same ( and different than 3D planes ), so theres no chance to simply turn on depth testing.


Here you can see that the tree is behind 'Sagaceil'. I'd like to test depth buffer correctly so if something covers text it shouldn't be visible.

Thank you for any ideas..

01-17-2010, 03:12 PM


01-18-2010, 01:30 AM
Can you outline your solution, so that others with same problem will find it too ?

Nice screenshots btw.

02-11-2010, 10:04 AM
Sorry to resurrect an old topic but I have the exact same issue - as the author did not post his solution does anyone else have any ideas?

02-12-2010, 09:17 AM
I would like to know that, too. ;)
But till then just print the name at the end. I mean, draw your scene and THEN draw the text which should be in forground.