[osg-submissions] RenderStage - Stencil Buffer is missing (patch)

Robert Osfield robert.osfield at gmail.com
Fri Apr 25 01:37:09 PDT 2008


Hi Art,


The answer is all is the code:

            if (!depthAttached)
            {
                fbo->setAttachment(osg::Camera::DEPTH_BUFFER,
osg::FrameBufferAttachment(new osg::RenderBuffer(width, height,
GL_DEPTH_COMPONENT24)));
            }

            if (!colorAttached)
            {
                fbo->setAttachment(osg::Camera::COLOR_BUFFER,
osg::FrameBufferAttachment(new osg::RenderBuffer(width, height,
GL_RGB)));
            }


Here the code checks to see if there has already been a depth
component attached, if not it attaches on, same for the color
component.  This means right now its not possible to create an FBO
using osg::Camera RTT without a depth and color component.   Relaxing
it would be to say it's OK to no have a depth or a color component.

Robert.


On Fri, Apr 25, 2008 at 9:33 AM, Art Tevs <stud_info2 at yahoo.de> wrote:
> Hi Robert,
>
>
>  >
>  > I'm afraid you've misread the code, the stencil
>  > buffer is supported,
>  > but if one isn't requested then there is no need to
>  > add one.  So the
>  > code you have added is not necessary at all.
>  >
>  Ok, I see. If it is not needed, then let it be. If
>  somebody requires it, he should provide a patch.
>
>
>  > One may also question on whether newer drivers
>  > actually require both
>  > of the a colour buffer and depth buffer, and this is
>  > what the fallback
>  > statements for the depth and colour buffers do - its
>  > these that you
>  > have copied.  After 2.4 we can look into relaxing
>  > the fallbacks for
>  > depth and colour but so close to a release I'm not
>  > prepared to go
>  > experimenting with potentially breaking changes.
>  >
>
>  I am afraid, I didn't understood, what you mean with
>  fallback to depth and color buffer. I am succesfully
>  using depth and color attachment on the camera in one
>  pass, hence the camera do render the scene into the
>  color buffer and depth buffer at the same time. This
>  doesn't produce any errors. Hence I am not sure, what
>  you mean with relaxaing the fallbacks for depth and
>  color.
>
>
>  Best regards,
>  Art
>
>
>
>  > Robert.
>  >
>  > On Thu, Apr 24, 2008 at 11:42 PM, Art Tevs
>  > <stud_info2 at yahoo.de> wrote:
>  > > Hi Robert,
>  > >
>  > >  just before the v2.4, there is one line missing
>  > in the
>  > >  current RenderStage.cpp.
>  > >
>  > >  In the method runCameraSetup the setup for
>  > stencil
>  > >  buffer is missing. You can see that between the
>  > lines
>  > >  350-359 the stencil attachmetn is missing. I have
>  > >  attached a patched file. Take a look. I haven't
>  > tested
>  > >  stencil attachment at all, hence I can not be
>  > sure if
>  > >  there is anything missing.
>  > >
>  > >  Even more, there are some extensions around,
>  > which
>  > >  enables depth buffer and stencil to be attached
>  > into
>  > >  one RenderBuffer, something like
>  > GL_DEPTH_STENCIL_EXT
>  > >  or  GL_DEPTH24_STENCIL8_EXT. I think if we
>  > provide the
>  > >  stencil attachmetn support, then we have to think
>  > on
>  > >  this extensions too. It would be nice if somebody
>  > >  could test stencil implementation as it is and
>  > provide
>  > >  a patch which includes all this functionality.
>  > >
>  > >
>  > >  Best regards,
>  > >  Art
>  > >
>  > >
>  > >
>  > >
>  > >
>  > >
>  >
>  __________________________________________________________
>  > >  Gesendet von Yahoo! Mail.
>  > >  Mehr Möglichkeiten, in Kontakt zu bleiben.
>  > http://de.overview.mail.yahoo.com
>  > > _______________________________________________
>  > >  osg-submissions mailing list
>  > >  osg-submissions at lists.openscenegraph.org
>  > >
>  >
>  http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>  > >
>  > >
>  > _______________________________________________
>  > osg-submissions mailing list
>  > osg-submissions at lists.openscenegraph.org
>  >
>  http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>  >
>
>
>
>       __________________________________________________________
>  Gesendet von Yahoo! Mail.
>  Mehr Möglichkeiten, in Kontakt zu bleiben. http://de.overview.mail.yahoo.com
>  _______________________________________________
>  osg-submissions mailing list
>  osg-submissions at lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>


More information about the osg-submissions mailing list