[osg-submissions] Bug in MRT and FBO
Art Tevs
stud_info2 at yahoo.de
Mon Jul 14 06:51:34 PDT 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Camera
Type: application/octet-stream
Size: 26198 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080714/794d51b3/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Camera.cpp
Type: text/x-c++src
Size: 14302 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080714/794d51b3/attachment-0001.cpp>
More information about the osg-submissions
mailing list