From Atr Tevs,
first email: "in the current implementation of osgUtil::RenderStage::drawInner() method, there is some wrong assumptions made. The problem is, that whenever one does use multisampling functionality, the Blit operation (which suppose to copy the content of multisampled FBO into the usual one) doesn't perform well in some cases. I've attached a corrected version of the RenderStage. It do just add one line, which enables the multisampled FBO as a readable just before the usual FBO is set as writable. With these corrections the Blit operation performs now correct and allows using of multisampled rendering results further." second email: "There was a problem when blitting the multisampled FBO with internal formats. The default internal format of color buffered multisample FBO was GL_RGBA. This has converted the color values whenever the FBO content was copied. I've added couple of lines, which do just enable the multisampled FBO internal format in respect to the attached color texture's internal format. This makes it possible to blit even float valued texture, so make HDR with multisampling possible ;)"
This commit is contained in:
parent
90afd31baa
commit
898a313272
@ -391,8 +391,14 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
|||||||
case Camera::PACKED_DEPTH_STENCIL_BUFFER:
|
case Camera::PACKED_DEPTH_STENCIL_BUFFER:
|
||||||
internalFormat = GL_DEPTH_STENCIL_EXT;
|
internalFormat = GL_DEPTH_STENCIL_EXT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// all other buffers are color buffers
|
||||||
default:
|
default:
|
||||||
internalFormat = GL_RGBA;
|
// setup the internal format based on attached texture if such exists, otherwise just default format
|
||||||
|
if (attachment._texture)
|
||||||
|
internalFormat = attachment._texture->getInternalFormat();
|
||||||
|
else
|
||||||
|
internalFormat = GL_RGBA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -894,6 +900,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bind the resolve framebuffer to blit into.
|
// Bind the resolve framebuffer to blit into.
|
||||||
|
_fbo->apply(state, FrameBufferObject::READ_FRAMEBUFFER);
|
||||||
_resolveFbo->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER);
|
_resolveFbo->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER);
|
||||||
|
|
||||||
// Blit to the resolve framebuffer.
|
// Blit to the resolve framebuffer.
|
||||||
|
Loading…
Reference in New Issue
Block a user