This seemed to work for me:

Osg::StateSet* state = geode->getOrCreateStateSet();


Osg::Depth* depth = new osg::Depth(osg::Depth::Function::ALWAYS);
state->setAttribute(depth);

-Or-

state->setRenderBinDetails(11,"RenderBin");

-Or- 

state->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
state->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

Have not tested lately

Hope this helps






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Pecoraro, Alexander N
Sent: Thursday, July 26, 2007 6:24 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Clear depth buffer


I was wondering if anyone could offer me a suggestion on how to force a
clear of the depth buffer in the middle of a rendering pass. I have a 3d
model that I want to show up right in front of the viewer and always be
on top. I used a absolute reference frame transform node and an
orthographic projection node to put the model in the middle of the
screen, but now when my viewer gets too close to other models they peek
through. I figure if right before I draw my orthographic model I clear
the depth buffer then I would guarentee that nothing would get draw on
top of my model (as long as I draw my model last). I found that I can't
just disable depth testing on the model because then the various pieces
of the model don't get drawn in the right order and so certain pieces
end up on top of pieces that they shouldn't end up on top of.

Any help?

Thanks.

Alex
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to