[osg-users] how to disable zbuffer

David Spilling david.spilling at gmail.com
Tue Jul 8 09:05:52 PDT 2008

If you just disable depth testing, or make the fragments always pass depth
testing via ALWAYS, you still don't get the effect that the object is always
visible, do you? It presumably will depend on its position in the scenegraph
and the relative order of drawing. That's why HUDs are often done in
post-render cameras...

If it's the stateset solution you want - rather than using a osg::Camera
with POST_RENDER - I think you might also want to force a draw to z=0, the
near clipping plane:

stateSet->setAttributeAndModes (new osg::Depth(osg::Depth::ALWAYS, 0.0,
0.0), osg::StateAttribute::ON);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080708/091b5b18/attachment-0003.htm>

More information about the osg-users mailing list