Hi Jannik,

depending on what you are doing in the drawImplementation(), I can think of
2 options.

If you need to modify the drawable/stateset you can actually deep copy you
drawable and use a "FrameSwitch" class as explained in this post (contains
a link to the code): http://forum.openscenegraph.org/viewtopic.php?t=14849

Otherwise if you need the frame number only as a reference, I think you
might "pile up" frame numbers during the cull visit, and then "consume"
them from your drawImplementation.

Ricky


On Wed, Feb 1, 2017 at 9:33 PM, Jannik Heller <scr...@baseoftrash.de> wrote:

> Hi,
>
> I'm trying to use the frame number of the FrameStamp in osg::State for a
> double buffering implementation in my custom drawImplementation() method.
>
> However, the frameStamp in osg::State is just a pointer so when the frame
> advances, it will be increased. The problem is that in DrawThreadPerContext
> mode, osg can advance the frame before the draw has completed, so the frame
> number seen in drawImplementation() could be one frame ahead in some cases.
>
> Any idea what to do? Do you think OSG should be changed to produce an
> accurate frame number for osg::State?
>
> Thank you!
>
> Cheers,
> Jannik
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70086#70086
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to