Hi,

This is my first post to OSG.  I'd like to thank all those that have 
contributed - I'm liking what I'm seeing :-)

I'm doing some stenciling based on the examples (using svn trunk, with 
ViewerCocoa (so, OSX)), but seeing strange results (what looks like a garbled 
stencil buffer).

Upon further examination (stopping on glClear in the OpenGL profiler) the 
stencil buffer isn't being included in the clear.  It seems the 
GL_STENCIL_BUFFER_BIT isn't making it's way to the RenderStage.  I've confirmed 
it's setup on the camera. I've confirmed that there's a stencil buffer included 
in the pixelFormat attributes when the context is created. Just doesn't seem to 
be making it to the RenderStage.

Unfortunately I've not managed to get the xcode debugger to play nice yet - and 
so I've not been able to step through to see how the clearMask is *supposed* to 
be set on the RenderStage.

Is there something obvious I'm missing?
The RenderStage clearMask is set to COLOR | DEPTH.

The camera is setup like so (directly after prepareOpenGL in the viewer):


Code:

osg::Camera *camera = osgViewer->getCamera();
camera->setClearStencil(0);
camera->setClearColor(osg::Vec4(1.0, 0, 0, 1.0));
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);




And my root group node in the scene is setup thus:

Code:

osg::ref_ptr<osg::Group> root = new osg::Group();
root->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::OFF);
root->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);




Any ideas?  

Cheers,
Neil

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=21193#21193





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

Reply via email to