[osg-users] Main branch MSFBO support change

Robert Osfield robert.osfield at gmail.com
Thu Nov 19 04:22:26 PST 2009


Hi Paul,

I haven't reviewed this submission yet, but it clearly overlaps with
the changes that Wojtek was working on.  I've already checked in some
of Wojtek's changes (the interface changes to osg::Camera and
osg::DisplaySettings) but haven't checked in the changes to
RenderStage.cpp.  I'm awaiting feedback from Wojtek before merging the
remaining elements his changes.

Could you give me a heads up on where you think we stand with respect
this submission?  Is it complimentary, no longer needed at all, will
need to be refactor?

I'll hold off from doing a review of your changes till you give me a heads up.

Cheers,
Robert.

On Sat, Oct 24, 2009 at 8:09 PM, Paul Martz <pmartz at skew-matrix.com> wrote:
> Hi Robert -- Here is my submission to increase application control over
> implicit creation of FBO attachments, MSFBO resolve attachments, and blit,
> as discussed in the thread "Improving multisampled FBO".
>
> By default, the current behavior is preserved, which means that OSG
> implicitly creates both color and depth FBO attachments if they were not
> already attached to the Camera. In the multisampled case, this is done for
> both the multisampled FBO as well as the resolve FBO.
>
> However, the app can now explicitly set a mask to control which attachments
> OSG creates implicitly, using Camera::setUseBufferMasks(). There is a mask
> bit for color, depth, and stencil. The default is USE_COLOR_BUFFER |
> USE_DEPTH_BUFFER.
>
> If you pass you parameter and are not using MSFBO, the mask controls the
> attachments to the rendered FBO.
>
> If you are using MSFBO, then you can pass two parameters: the first controls
> attachments to the multisampled FBO, and the second controls attachments to
> the resolve FBO.
>
> I've also changed the computation of the glBlitFramebuffer mask. Formerly,
> this iterated over all attachments to compute the mask, once per frame --
> very inefficient. This was really unnecessary, as OSG always copies all
> attachments. Now, the code simply sets all bits and lets OpenGL sort it out.
> (OpenGL silently ignores a bit if the attachment isn't set in both the
> source and destination FBOs.)
>
> This gives me a permanent fix for the glBlitFramebuffer issue on OS X, as I
> can now explicitly leave the depth buffer out of the resolve FBO.
>
> (As an additional aside, I'll note that the current FBO handling by Camera
> and RenderStage is pretty hairy and it'd be nice to completely scrap and
> reimplement this. However, it'd be difficult to do so without breaking
> backwards compatibility. So, this is best left for an OSG v3.0 change.)
> --
> Paul Martz
> Skew Matrix Software LLC
> _http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
> +1 303 859 9466
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


More information about the osg-users mailing list