Hi all,
Thank you for the reply, Robert.
Your recommendation worked well for clearing the stencil buffer. I ran
into another problem, however. The lighting of the object I am
outlining does not match the lighting for the rest of the scene. It
seems as if the position of the light has been reset.
I looked through CullVisitor.cpp and noticed the following comments in
the "apply" function for camera nodes:
// set up lighting.
// currently ignore lights in the scene graph itself..
// will do later.
Is this the source of my problems?
Note that I have not transitioned to 2.6.0 yet.
I appreciate the help,
-Chris
On Aug 12, 4:08 pm, "Robert Osfield" <[EMAIL PROTECTED]> wrote:
> 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 andstencilbuffers. 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 thestencilbuffer, 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 usestencilbuffers 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 thestencilbuffer, 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
> > thestencilbuffer.
>
> > This is a long way of saying: How do I clear thestencilbuffer 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 thestencilbuffer 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...
>
> _______________________________________________
> osg-users mailing list
> [EMAIL
> PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...-
> Hide quoted text -
>
> - Show quoted text -
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org