Hi Marko,

You could use a Camera::FinalDrawCallback to sync, or simply run the
viewer in CullThreadPerContext or SingleThreaded threading model.
It's only the default DrawThreadPerContext (default on multi-core
systems) and CullThreadPerCameraDrawThreadPerContext threading models
that allow the next frame to start while static objects are still
being drawn.

Robert.

On 19 June 2013 13:34, Marko Srebre <[email protected]> wrote:
> Hello,
>
> I am having a compute pipeline (physics simulation) that ends with a camera 
> that renders to an image (for further processing on cpu). I'd like the 
> Viewer::frame() to exit only after the image has been rendered to, so that 
> update traversal happens after the data has been downloaded to image.
>
> I am familiar with the workings of
>
>
> Code:
> setDataVariance(osg::Object::DYNAMIC),
>
>
>
> but this unfortunately applies to drawables, not the output image. If I set 
> data variance to dynamic, the frame() will wait to process the drawables for 
> the camera node, but exit right after, not waiting for the render to image to 
> finish. The only way I could figure out, to make it wait, is to set up a 
> dummy camera (with dynamic variance) with a render order right after my 
> image-camera. That works, but I was hoping there is nicer solution to this 
> problem that I am missing.
>
> I was also considering camera PostDraw callback, but it doesn't really solve 
> the problem, since the downloaded data won't be available in the next frame 
> update travesal.
>
> If anyone can share some experience on this matter, I'd appreciate it. Thanks.
>
> Cheers,
> Marko
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=54699#54699
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to