Hi Robert, Paul

I think having FBOs as a StateAttribute shouldn't  be changed. In this way one 
can use FBOs also without cameras, which is very appropriate for osgPPU for 
example.

However I think we should change how they are handled by the cameras. Currently 
there is a problem when mixing FBOs in cameras and FBOs as StateAttributes 
inside one scene graph. Here is a simple scene graph which breaks camera's FBO:

root
|
camera (with FBO) 
|
scene -- node B -- node C
|
FBO (StateAttribute)
|
node A

If rendering the scene like this, then the node A is get correctly rendered 
into the FBO. However, node B and C are then not rendered into the camera's FBO 
but just onto the screen.
The problem is, that camera's FBO is not handled like a StateAttribute, which 
cause osg to restore the state before FBO of node A was applied. When it 
restores the state, it does not bind the previously bounded FBO back, but it 
just bind an FBO with id 0. This means that everything rendered afterwards is 
not rendered into camera's FBO anymore but just on the screen. 

So, what I would propose is to change the way, how camera handles FBOs. Maybe 
we should always place an FBO as stateattribute just right after the camera 
before the camera's subgraph?

So, I agree that there must be done some changes in current situation. However, 
I would propose to let FBOs as StateAttributes and get them out of the camera, 
osgUtil::RenderStage and every other place, where they are unapropriate. So put 
the functionality of osgUtil::RenderStage into the FBO. This would reduce the 
dependencies between osgUtil and osg and should collect the code on its right 
place. Even more the FBOs can then still be used just as StateAttributes 
allowing specifing rendering into an FBO directly without any camera inbetween. 

What do you think?

Cheers,
art

robertosfield wrote:
> Hi Paul,
> 
> On Sat, Oct 10, 2009 at 8:29 PM, Paul Martz <> wrote:
> 
> > Hi Robert -- Someone recently pointed out to me that FrameBufferObject is a
> > StateAttribute. As I'm looking at ways to improve how OSG handles FBOs, I
> > wanted to make sure I understood the reason for this. FBO never seems to be
> > used as a StateAttribute; as far as I know, you can't attach it to a
> > StateSet, for example. Can you shed any light on this?
> > 
> 
> Actually I'm not sure of the reason now, been quite a few years since
> I merged the initial submission.  Perhaps the original logic was that
> it may have appropriate to attach as a StateSet, but in the end the
> way it's been used in the OSG is primarily via osg::Camera.
> 
> Robert.
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


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





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

Reply via email to