Hi J.P, On Fri, Apr 18, 2008 at 11:20 AM, J.P. Delport <[EMAIL PROTECTED]> wrote: > Yes, I think I know what is wrong. > > Remember how you modified the enum Camera::BufferComponent so that > COLOR_BUFFER and COLOR_BUFFER0 were not the same? When glDrawBuffers was > in RenderStage, it knew to only enable MRT when COLOR_BUFFER0 or later > was attached. > > However, the fbo->setAttachment call is the same for COLOR_BUFFER and > COLOR_BUFFER0. So now FBO internally incorrectly calls glDrawBuffers > when COLOR_BUFFER (vs COLOR_BUFFER0) is attached and this causes the error.
Reviewing the code in RenderStage I can see that the use of OpenGL enum GL_COLOR_ATTACHMENT0_EXT for both osg::Camera::COLOR_BUFFER and osg::Camera::COLOR_BUFFERi is the source of the problem i.e. FBO starts assuming its using MRT even when its not actually been requested. Here lies the problem with implicitly turning on/off MRT. > I'm not sure how to fix this without changing fbo->setAttachment. Still > looking... Change FBO so that it used osg::Camear::BufferComponent rather than GLenum would be one way, as this would allow use to differentiate properly. Changing setAttatchment(GLenum,..) to setAttatchment(osg::Camera::BufferComponent, ..) would however break backwards compatibility. Perhaps we could have both? I'll investigate this avenue. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org