[osg-users] Frame Buffer Object
person1001 at linuxmail.org
person1001 at linuxmail.org
Thu Nov 29 08:46:09 PST 2007
I think you could use a Pixel Buffer(Pbuffer) for better compability. Check out the osgprerender example. Basically you use PIXEL_BUFFER_RTT or PIXEL_BUFFER instead of FRAME_BUFFER_OBJECT. But from Roberts answer I understand that this shouldn't be necessary.
FBO:s allow for several attachment points so you need to tell the camera object to which you want to attach your texture.
CameraNode::FRAME_BUFFER, CameraNode::FRAME_BUFFER_FBO etc is the render target implementation. In other words it tells OSG which of the possible methods (FBO:s, pbuffers, etc) to use.
Check out these slides from nvidia explaining pbuffers and FBO:s, pros and cons:
> ----- Original Message -----
> From: "Robert Osfield" <robert.osfield at gmail.com>
> To: "OpenSceneGraph Users" <osg-users at lists.openscenegraph.org>
> Subject: Re: [osg-users] Frame Buffer Object
> Date: Thu, 29 Nov 2007 16:23:17 +0000
> Hi Zhangguilian,
> The RTT support in osg::Camera (Node) is designed to be able to cope
> well when the desired target implementation is not available - it uses
> a fallback mechanism.
> RTT support has steadily improved so you may well find that things
> just work better in OSG-2.2.
> On Nov 29, 2007 3:04 PM, zhangguilian <zhangguilian at ict.ac.cn> wrote:
> > Hello,
> > I want to use Render To Texture in an algorithm of reflection, I have read
> > some osg1.2 examples using RTT such as:
> > // set the camera to render before the main camera.
> > camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
> > // tell the camera to use OpenGL frame buffer object where
> > supported.
> > camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
> > // attach the texture and use it as the color buffer.
> > camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
> > My reflection algorithm works well on the machines that support FBO,but
> > has no effect on the machines that cann't support FBO,
> > I am trying to solve this problem by replacing all the parameters of
> > setRenderTargetImplementation including FRAME_BUFFER, but still cann't
> > solve,
> > Is it because the frame buffer is cleared in the steps afterwards on thoes
> > machines that don't support FBO?
> > I don't know the relationship between the parameter
> > "osg::CameraNode::COLOR_BUFFER" of attach and the parameter
> > "osg::CameraNode::FRAME_BUFFER"
> > of setRenderTargetImplementation, and what's the relationship of these two
> > functions?
> > And I am eager to know how can I make the reflection algorithm work well on
> > machines without FBO,
> > Copy the data from framebuffer to texture(or image)
> > somewhere(osg::CameraNoded:: DrawCallback?)?
> > Thanks very much!
> > ________________________________
> > zhangguilian
> > 2007-11-29
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> osg-users mailing list
> osg-users at lists.openscenegraph.org
Powered by Outblaze
More information about the osg-users