<div dir="ltr"><div><div><div>Hi Björn,<br><br></div>The driver will be queuing up multiple frames in the FIFO, something it does to help improve the framerate, but increases frame latency.  <br><br></div>We aren't powerless in this though, modern drivers and hardware support putting fences into the pipeline and waiting on these to be completed on the GPU.  In the svn/trunk vesion of the OSG you'll find a swap buffers SyncSwapBuffersCallback implementation that does this for you.  You can enable this via the env var OSG_SYNC_SWAP_BUFFERS=ON, or --sync on the command line for examples like osgviewer.<br><br></div>Robert.<br><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 April 2015 at 13:59, Björn Blissing <span dir="ltr"><<a href="mailto:bjorn.blissing@vti.se" target="_blank">bjorn.blissing@vti.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have made some experiments in regards to rendering latency in OpenSceneGraph. I have written a small test program which just shows one quad. During program execution the quad changes color from black to white 20 times. To my computer I have connected a light-to-voltage sensor which is attached to my monitor, the monitor is an Eizo LCD running in 60Hz.<br>
<br>
The setup allows me to log the time it takes for me to send a frame with the new quad color to when the light sensor picks up this change.<br>
<br>
The results surprised me a bit:<br>
<br>
Running with VSync OFF: min = 6ms, max = 21ms, mean = 14ms<br>
Running with VSync ON: min = 81ms, max = 96 ms, mean = 91ms<br>
<br>
So enabling VSync on my Nvidia card gave a increased latency of 75 ms, almost 5 full screen refreshes.<br>
<br>
Then I remembered that Robert said something about running OSG single threaded would give the lowest latency.<br>
<br>
So I set my application to run as single threaded:<br>
<br>
VSync ON, OSG single threaded mode: min = 43ms, max =  64ms, mean =  57ms<br>
<br>
Still a bit high, almost 3 full screen refreshes.<br>
<br>
So I poked around the NVidia settings with help of the Nvidia Inspector, which gives detailed control. The lowest latency I have been able to reach is with VSync enabled is the following setting combination:<br>
<br>
VSync = ON<br>
Maximum prerendered frames = 1<br>
Frame rate limiter = 60fps<br>
Threaded optimization = Off<br>
<br>
With these settings I have recorded the following latencies:<br>
<br>
Custom settings: min = 17ms, max =  42ms, mean =  30ms<br>
<br>
The mean difference between VSync OFF and this custom setting is 16 ms, i.e. about 1 screen refresh.<br>
<br>
I guess it is hard to push the latency any lower. Or is there any other setting which could reduce the latency even further?<br>
<br>
Test have been run on a computer with: Windows 7 64bit + Nvidia GTX570 with driver 347.52 + OSG 3.2.1<br>
<br>
Best regards<br>
Björn<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=63433#63433" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=63433#63433</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>