[osg-users] Enabling Vsync gives dramatic increase in latency

Jan Ciger jan.ciger at gmail.com
Tue May 12 08:07:56 PDT 2015

Hello Björn,

On Tue, May 12, 2015 at 4:20 PM, Björn Blissing <bjorn.blissing at vti.se>

> Hi again,
> I repeated my measurements with a pure OpenGL application and compared
> them to the previously recorded data from OSG:
> OpenGL + Nvidia Defaults + Vsync On Min: 56.7 Max: 65.0 Avg: 60.8
> OpenGL + Nvidia Defaults + Vsync Off Min: 2.9 Max: 25.0 Avg: 14.6
> OSG 3.2.1 + Nvidia Defaults + VSync On Min: 59 Max: 65 Avg: 62
> OSG 3.2.1 + Nvidia Defaults + VSync Off Min: 6 Max: 21 Avg: 14
> So it seems that OSG does not add any additional latency compared to a
> pure OpenGL application.
> I repeated the measurements with Windows Desktop Window Manager both on
> and off, but these measurements had no discernible difference.
Did you try to call glFlush() at the end of the each frame in your OpenGL
application? That should force the driver to not buffer but to actually
hold your program until the vsync event. Right now you are rendering much
faster than the GPU can scan out, so your program blocks only once the
rendering queue becomes full - which seems to be about the 3 frames of

glFlush() is bad for performance because it stalls the GPU on every frame
but should lower the latency from the fixed 60ms you see with vsync on.

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

More information about the osg-users mailing list