[osg-submissions] Bug in MRT and FBO

Robert Osfield robert.osfield at gmail.com
Mon Jul 14 12:52:57 PDT 2008


Hi Art,

COLOR_BUFFER != COLOR_BUFFER0 is a *deliberate* choice, and was done
to prevent problems with knowing when to enable MRT and when not to,
there was a long discussion on this topic a few months back when full
MRT support was introduced.  So your fix will not be merged.

Could you be much more precise in explaining what problem you have and
we can then work out what the appropriate solution would be.

Robert.

On Mon, Jul 14, 2008 at 2:51 PM, Art Tevs <stud_info2 at yahoo.de> wrote:
> Hi folks,
>
> current implementation of MRT is not correct. The issue comes whenever one tries to attach more than one render target to a FBO using the setAttachment(GLenum,...) method. For example something like this:
> fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT, ..)
> fbo->setAttachment(GL_COLOR_ATTACHMENT1_EXT, ..)
> fbo->setAttachment(GL_COLOR_ATTACHMENT2_EXT, ..)
> fbo->setAttachment(GL_COLOR_ATTACHMENT3_EXT, ..)
>
> The conversion of glenum to Camera::BufferComponent is correct however in the FrameBufferObject::updateDrawBuffers the attachments are only added if attachment point is >= Camera::COLOR_BUFFER0 && <= Camera::COLOR_BUFFER15
> However Camera::COLOR_BUFFER and Camera::COLOR_BUFFER0 are not equal, hence the first attachment is never attached.
>
> The patch do just change the definition in Camera class adding COLOR_BUFFER=COLOR_BUFFER0. This is actually also the intuitive meaning of that values ;)
>
>
> NOTE:
> - "Camera.cpp" goes into src/osgPlugins/osg/
> - "Camera" goes to include/osg/
>
> Best regards,
> Art
>
>
>
>      __________________________________________________________
> Gesendet von Yahoo! Mail.
> Dem pfiffigeren Posteingang.
> 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