[osg-users] Setting view matrix seems to lag behind on frame

Robert Osfield robert.osfield at gmail.com
Tue Dec 1 08:28:45 PST 2015

Hi Sebastian,

On 1 December 2015 at 16:12, Sebastian Messerschmidt <
sebastian.messerschmidt at gmx.de> wrote:

> Sorry for answering my own question:
> The reason- of course- is threading. When setting the threading model to
> single-threaded the correct matrix is used in the frame.

I just had a look at the code, you don't set the DataVariance of the
osg::Geometry to DYNAMIC so when the viewer runs multi-threaded the vertex
update code can update the geometry whilst the previous frame is still
being rendered.  So rather than the camera lagging the geometry by a frame,
it's the geometry actually jumping ahead of the camera.

It's a subtle little bug but quite a good class example of the challenges
of trying debug multi-threaded applications :-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151201/c14eac81/attachment-0003.htm>

More information about the osg-users mailing list