Changeset 8308

Show
Ignore:
Timestamp:
05/12/08 13:39:02
Author:
robert
Message:

From Mathias Froehlich, Fixed FrameBufferObject? attachement code to handle cases
where no texture or image is attached

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/src/osgUtil/RenderStage.cpp

    r8139 r8308  
    341341                osg::Camera::Attachment& attachment = itr->second; 
    342342                 
    343                 fbo->setAttachment(buffer, osg::FrameBufferAttachment(attachment)); 
     343                if (attachment._texture.valid() || attachment._image.valid()) 
     344                    fbo->setAttachment(buffer, osg::FrameBufferAttachment(attachment)); 
     345                else 
     346                    fbo->setAttachment(buffer, osg::FrameBufferAttachment(new osg::RenderBuffer(width, height, attachment._internalFormat))); 
    344347                 
    345348                if (buffer==osg::Camera::DEPTH_BUFFER) depthAttached = true;