Added support for multiple colour buffers into osg::CameraNode/osgUtil::CullVisitor

This commit is contained in:
Robert Osfield
2005-07-19 20:01:00 +00:00
parent 8dd013171c
commit 7b23cf930e
2 changed files with 11 additions and 3 deletions

View File

@@ -214,9 +214,17 @@ class OSG_EXPORT CameraNode : public Transform, public CullSettings
enum BufferComponent
{
COLOR_BUFFER,
DEPTH_BUFFER,
STENCIL_BUFFER
STENCIL_BUFFER,
COLOR_BUFFER,
COLOR_BUFFER0 = COLOR_BUFFER,
COLOR_BUFFER1 = COLOR_BUFFER+1,
COLOR_BUFFER2 = COLOR_BUFFER+2,
COLOR_BUFFER3 = COLOR_BUFFER+3,
COLOR_BUFFER4 = COLOR_BUFFER+4,
COLOR_BUFFER5 = COLOR_BUFFER+5,
COLOR_BUFFER6 = COLOR_BUFFER+6,
COLOR_BUFFER7 = COLOR_BUFFER+7
};
void attach(BufferComponent buffer, GLenum internalFormat);

View File

@@ -1198,7 +1198,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
}
default:
{
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT, osg::FrameBufferAttachment(attachment));
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT+(buffer-osg::CameraNode::COLOR_BUFFER0), osg::FrameBufferAttachment(attachment));
colorAttached = true;
break;
}