lesson 17: font always on top?
Hi!
i have implemented my fonts just like lesson17 describes them (texture mapped quads). works fine, but a problem is that if i first write the text, then draw some geometry, the geometry always overdraws the font. i tried to set the z-coordinate of the text to a value far closer to the camera than every other object, and i enabled GL_DEPTH_TEST for rendering but it didn't work.
is there a way around this problem? or do i have to draw fonts AFTER everything else? i remember that when you have transparent objects you have to draw them last, and my fonts are transparent, after all....
cheers
chris
I haven't looked at Lesson 17, but typically when drawing text one either (a) renders text last, disabling depth testing for the fonts (not necessarily for the other objects); or (b) positions text at
the closest possible screen coordinates and clips other objects just in front to avoid artifacts. I typically use (a), as do most of the demos I've seen.
the closest possible screen coordinates and clips other objects just in front to avoid artifacts. I typically use (a), as do most of the demos I've seen.
---blahpers
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement