Hi,
paul1...@yahoo.com wrote:
Thanks JP for the response but I'm not sure I understand..
I want frames 0 to 14 (and 16-30, 32-46, etc) to be done as fast as
possible and not wait on VSYNC. I only want the rendering of the 15th
frame (and 31, 47, etc) to wait on VSYNC.
I'm not 100% sure how to do this. You might have to get OSG (aka hack
the frame call) to do update, cull and draw, but not call swapbuffers
(which is where I think the wait on vsync would happen).
If by frame, you mean a call to osgViewer::frame, then I'm confused
on how to make this call sometimes block on VSYNC and other times
not..
Yes, in my prev email "frame" meant a call to OSG's frame (i.e. update,
cull, draw). Since you want to update a matrix using a callback, you
will have to let the callback execute and then let a specific camera (or
group) render (update, cull, draw) for that specific scene. The trick
would now just be to fix the vsync, see above.
SHORT FORM of my original question: If I can have a shared scene
graph attached to multiple camera, how do I update my scene graph
(i.e. change a MatrixTransform) such that different scenes are drawn
for each camera?
I don't think you can easily do this in a single OSG frame, because you
actually want multiple OSG frames (modified scenes) to contribute to
your final "frame". That is why I suggested you do the updates in
multiple OSG frames and only make every 16th one visible to the screen.
HTH
jp
LONG FORM of my question: To restate my original problem, I have a
scene graph representing my scene. I currently move my players in the
scene graph using an update callback on a MatrixTransform. Now, I
want to add the ability to average up to 16 frames together before
sending it to the frame buffer. Since I will be using a shader to
average my subframes and I'm not allowed to have the same
(accumulator buffer) temporary buffer used as an input to a shader as
well as a rendering target, I assume I'll need 16 camera each
rendering an appropriate rendering texture and configured with an
input texture. I would then have my (common) scene attach to each of
these cameras.
My problem is that as I understand OSG and osgViewer, it will perform
an update traversal on the entire scene graph (ie.all cameras) before
proceeding to the cull traversal. If I move my players in my update
callback, by the time I get to the cull operation, all the cameras
will be looking at a (common) scene with the MatrixTransform nodes
now only having the FINAL player position information. OSG also seems
to do a cull on the entire scene graph as well. Is there a way to do
an update/cull/draw on a per camera basis before moving to the next
camera in the scene graph?
I hope this makes sense.
Paul P.
----- Original Message ---- From: J.P. Delport <jpdelp...@csir.co.za>
To: OpenSceneGraph Users <osg-users@lists.openscenegraph.org> Sent:
Wednesday, August 19, 2009 3:22:04 AM Subject: Re: [osg-users]
Temporal Averaging
Hi,
paul1...@yahoo.com wrote:
I know I've asked similar questions before but now I'm looking to
use OSG to perform temporal averaging differently than I've asked
before.
Is there a way to perform an "update", "cull" and "draw" on only a
sub part of the scene graph?
I want to average (say) 16 successive frames. For example,frames
1-16 should be average together and the final average being sent to
the frame buffer. Same for frames 17-32, 33-48, etc.
To do this, I assume I'll need 16 "cameras" all looking at the same
scene graph. The first 15 would be rendering to a texture which is
passed to the next camera while the last simply renders to frame
buffer. Since I want to "move" the players slightly between each
camera node, how would I do this? Normally, an update callback
would be called on the entire scene graph but I'll have a "shared"
scene graph so I don't think this will work.
Any words of advice?
Maybe: Create main texture (mt) to be used by main camera (MC).
Create 16 cameras for RTT (RTT1-16) with 16 textures (st1-16), this
is where your scene is attached. Create one RTT camera (AV) to do
average of 16 textures and render to mt
frame 0: enable RTT1, disable AV, MC renders mt frame 1: enable RTT2,
MC renders mt ... frame 15: enable RTT16, enable AV and render to mt,
MC renders mt. frame 16: enable RTT1, disable AV, MC renders mt ...
IOW main camera texture would only update every 16th frame. Updates
to the scene would be like normal between the frames. So the
rendering is more spread out and not compressed into a single main
frame. The overhead of rendering the main texture 16 times should be
minimal, unless you have vsync :( Maybe you can disable swapping for
the in between frames.
You might also be able to get away with less cameras and flip
flopping the sum texture and the main texture.
jp
Thanks, Paul P.
_______________________________________________ osg-users mailing
list osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-- This message is subject to the CSIR's copyright terms and
conditions, e-mail legal notice, and implemented Open Document Format
(ODF) standard. The full disclaimer details can be found at
http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean. MailScanner thanks
Transtec Computers for their support.
_______________________________________________ osg-users mailing
list osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing
list osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org