Hi Roman,

On Tue, May 20, 2008 at 9:10 AM, Роман Григорьев <[EMAIL PROTECTED]> wrote:
> Hi I try to implement cellular automata clouds on OSG and have some problem
>
> 1) I can't use (or don't know)  ping-pong rendering technique as described
> here http://www.m3xbox.com/GPU_blog/?m=200712
>
> Because when I attach 2 textures to camera FBO in rendering loop camera
> render to 2 FBO but I need to change dynamically which draw buffer I need to
> draw/ I've red about RenderStage but how to control it is unclear for me.
> I've make a workaround that create another camera that render FBO texture to
> another FBO texture that can I attach in 1 stage to calculate cellular
> automata.

The core OSG doesn't support ping pong rendering out of the box right
now.  For this we'd need to have multiple osg::Camera sharing the same
FrameBufferObject.   Right now you could try sharing the same
RenderCache (which is actually a RenderStage) but this is not what you
actually need - you need seperate RenderStages, each sharing the same
FBO.

Evolving the OSG's RTT support to support ping pong rendering is
something we can discuss.

The other route would be to write a custom node or cull callback that
does the same job as osg::Camera w.r.t RTT, but does all the set up of
the separate RenderStage and sharing of FBOs.  There is a chance that
the osgPPU library does something like this already.

> 2) I'd like to do RTT rendering not in every frame. But As I understand OSG
> create rendercashe to strore rendering order how can I dynamically attach
> and remove camera from rendering order?

You can control whether a Camera is rendered by toggling it's
NodeMask, by setting it to 0x0 you switch it off.  Another alternative
is to use an osg::Switch above the Camera(s).

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to