Text without Z buffer



I want to label my vertices, which I'm rendering as cubes, with red text
overlaying the cube at the cube's location. I am showing text using
glCallLists (wrapped by a class) after the rest of my scene is rendered,
and it works just fine as long as I offset the text to an area of the
display with nothing else drawn.

If I try to display my text at the same point where the cube is rendered,
the text is obscured by the cube. The cube is centered around the point
where it's drawn.

This is the snippet of code I'm using to draw the text:

glDepthMask(GL_FALSE);
glColor3f(1,0,0);
.... text drawn here...
glDepthMask(GL_TRUE);

I thought that glDepthMask(GL_FALSE) disables the depth buffer, and that
disabling the depth buffer before rendering prevents newly drawn pixels
from being obscured.

.



Relevant Pages

  • Re: display list optimization / performance
    ... I use hierarchical rendering, lets say a cube, used in many ... largely biased to the overhead. ... actually gain the performance of display lists. ...
    (comp.graphics.api.opengl)
  • Rendering grid of cubes. Ray casting?
    ... I m interested in rendering a grid in the x,y plane. ... represents a cube of the respective height. ... The view point would always be the bird's eye view of the grid. ... num is the number of visible cubes ...
    (comp.graphics.algorithms)
  • problems with rendering to texture
    ... I have a problem with rendering to texture. ... I'm using glCopyTexImage2D ... When I'm trying to render a cube where each vertex has different ...
    (comp.graphics.api.opengl)
  • Re: Text without Z buffer
    ... I am showing text using glCallLists after the rest of my scene is rendered, and it works just fine as long as I offset the text to an area of the display with nothing else drawn. ... If I try to display my text at the same point where the cube is rendered, ... disabling the depth buffer before rendering prevents newly drawn pixels from being obscured. ...
    (comp.graphics.api.opengl)
  • Re: Thinking outside the box
    ... vertices of the cube adjacent to a given vertex. ... You have just drawn an ... equilateral triangle. ... The sheet of paper is not required. ...
    (rec.puzzles)

Loading