Thanks for your help, I'll check into the Camera callback. I've dissected the 
the osgfpdepth example already ... that's where I learned to do the floating 
point depth buffer and the anti-aliasing setup for a frame buffer object. I'll 
look into it again to see if I've missed something ...

I'm fairly certain that I'm approaching it the correct way as RenderStage calls 
glBlitFramebuffer(...) to blit from a buffer to a texture according to a buffer 
attachment map owned by its resolve FBO :


Code:
GLbitfield blitMask = 0;
//find which buffer types should be copied
for (FrameBufferObject::AttachmentMap::const_iterator
it = _resolveFbo->getAttachmentMap().begin(),
end =_resolveFbo->getAttachmentMap().end(); it != end; ++it)
{
switch (it->first)
{
case Camera::DEPTH_BUFFER:
blitMask |= GL_DEPTH_BUFFER_BIT;
break;
case Camera::STENCIL_BUFFER:
blitMask |= GL_STENCIL_BUFFER_BIT;
break;
case Camera::PACKED_DEPTH_STENCIL_BUFFER:
blitMask |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
break;
case Camera::COLOR_BUFFER:
blitMask |= GL_COLOR_BUFFER_BIT;
break;
default: ...
}
}
// Bind the resolve framebuffer to blit into.
_fbo->apply(state, FrameBufferObject::READ_FRAMEBUFFER);
_resolveFbo->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER);
if (blitMask)
{
// Blit to the resolve framebuffer.
fbo_ext->glBlitFramebuffer(
0, 0, static_cast<GLint>(_viewport->width()), 
static_cast<GLint>(_viewport->height()),
0, 0, static_cast<GLint>(_viewport->width()), 
static_cast<GLint>(_viewport->height()),
blitMask, GL_NEAREST);
}


[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48145#48145





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to