Don Leich wrote:
Hi all,

I needed to change an HUD camera so that it would write into the depth
buffer.  To get it to work I had to do something that I don't understand.
I thought that a depth range of (0.,0.) and function of ALWAYS should cause
all subsequent rendering to write at the minimum depth value.  Doing so
would render lines OK but all filled polys and text went missing.  I found
that I had to open up the range a bit in order to see these too.

Hi Don -- I've found that a more direct way to write to the min z value is to use a vertex shader that outputs gl_Position with z = -1 and w = 1.

Regardless, there's no reason why your technique shouldn't work in plain OpenGL:
  http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml
Not sure why this isn't working in OSG. First thing to do would be set a breakpoint in your Drawable's draw() to see whether or not drawing commands are being sent to OpenGL. If your breakpoint doesn't get hit, then you've narrowed it down to an OSG issue. If the OpenGL drawing commands are getting issued, then something about the OpenGL state machine is being misconfigured.

--
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to