The application requires anti-aliasing of a scene and the subsequent creation of floating point color and depth textures that can be sampled and used like any ordinary texture. Specifically I need to do the following:
1) Render the scene to an offscreen FBO that has float color and depth render buffers attached to it and is configured for AA
2) Automatically blit the color and depth buffers in the FBO to another FBO that has attached float color and depth textures.
3) Query/sample the depth texture and map the color texture onto a quad
I have successfully got this to work in standard OpenGL. Now I am trying to understand how to do this in an OpenSceneGraph context. I see that RenderStage has what I need in terms of the render buffer and resolve buffer blit … good so far …
So … I suspect that what I need to do is to get a pointer to a RenderStage and configure that instance. I have a custom camera class (class IRCamera : public osg::Camera) that I am using for offscreen rendering. Currently it just has a color texture attached to it and I am using that rendered texture successfully. I want to rework this custom camera class to use the multi-stage approach so that I can take advantage of AA and still have the rendered results in a texture.
Is there a way for me to get a pointer to a RenderStage instance associated with my custom camera? Is this the proper approach for what I want to do?
Thanks in advance,
Paul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48142#48142
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
It seems like the multipass rendering you describe below could be accomplished
by using a series of Cameras. In OSG these must be arranged hierarchically, but
you set the Cameras as pre- or post-render to specify the sequential rendering
order. There's an osgprerender example that uses multiple Cameras, which you
might find helpful.
-Paul