I'm attempt to develop a Multiple Render Target (MRT) program and have a few
questions..
First, I see this in the osgstereomatch example:
Two textures are needed, because shaders cannot read and write to the same
texture during calculation. One texture is used as input and the other as
output. After a calculation, the input and output textures are swapped. The
technique is known as ping-ponging or flip-flopping the textures.
What does this mean? Can I have the same texture defined as input (assigned to
the StateSet) and still have it attached (but not used) as a render target? In
short, I see how I can ping-pong the input by changing the texture uniform but
how do I ping-pong the "attached" render buffer? Can I "attach" all my render
targets but then not use them (if it's an input)?
What happens if you do read and write to the same texture each frame? Also,
does this clear all my render targets (between frames):
_Camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
What I'm trying to do is calculate a temporal averaging of a specific number of
consecutive frames. I assume I need to keep a running average of frames as well
as well as save each of the frames. Then each frame:
SUM = (SUM - oldestFrame + newFrame)
and
Output = SUM/numberOfFrames;
I think I'm done asking questions for now :-).
Thanks for any help you can provide...
Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org