Hi Chris, In OSG-2.6 the osg::Camera and associate rendering setup code in the rendering backend provide support for controlling the clearing of colour, depth and stencil buffers. You could use this to do your multipass technique by decorating the phase you want to control with a Camera that sets the clear of the stencil buffer, but not the colour or depth.
Robert. On Tue, Aug 12, 2008 at 8:59 PM, Chris Glasnapp <[EMAIL PROTECTED]> wrote: > Hello, > > This is my first post, so please forgive any breech of etiquette. > > I'm trying to use stencil buffers to achieve outlines around my > objects, as described in the following article: > http://www.codeproject.com/KB/openGL/Outline_Mode.aspx > > I want to be able to display the outlines of objects regardless of > whether they are behind another object or not. For example, say I have > two objects: A and B. If Object A is partially occluded by Object B, I > want to display the entire outline of Object A, even the occluded > part. > > The problem I'm running into is that when Object B is rendered first, > the silhouette for Object B is in the stencil buffer, which prevents > the outline surrounding the occluded parts of Object A from being > drawn. > > Similarly, if Object A is rendered first, a part of the outline for > Object B will not be drawn because the silhouette of Object A is in > the stencil buffer. > > This is a long way of saying: How do I clear the stencil buffer in the > middle of rendering? > > I took a look at osg::ClearNode, but when I set its clear mask to > GL_STENCIL_BUFFER_BIT, it had an effect as if I had cleared the > GL_COLOR_BUFFER_BIT instead. > > I am aware of the polygon offset method of outlining objects, but have > found the stencil buffer method to be much more accurate in my > application. > > Thanks, > -Chris > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

