Forcing vsync off for testing in Windows 10 (now with Video)

I am hunting down performance issues right now, with a growing distrust in the built in profiler’s readings. Thus I turned to the concept of Nvidia’s FCAT (http://www.geforce.com/hardware/technology/fcat) to measure the actual frame times at the end of the pipeline.

The question now is: how can I force unity (editor or build, anyone would be good start) to vsync off?

From what I found online so far, there seem to be issues with the borderless fullscreen mode with DX11. The windows are not real fullscreen, it’s just a screen filling windows without the chrome. Thus, it seems, there is now way to really achieve vsync-off. The window contents are only updated with the desktop at 60Hz.

Setting vsync off via code simply results in dropped frames. Unity renders as if vsync was off but the additional frames are simply dropped. The problem is, that the profiler then either shows weird spikes for GFX.waitForPresent, or shows spikes in seemingly unrelated parts of the code.

forcing vsync of in the AMD driver also had no effect.

I found some info on exclusive full screen mode, but nothing coherent. It seems as if this was the solution, but also as if it was broken for some time now in unity (also making gsync and free sync useless)

My current setup is 3 screens and a capture card, with fairly recent drivers.

1 Like

Have you tried to change it in Edit ->Project settings - > quality, and set ‘V Sync count’ to “don’t sync”.

Basically this should do it. Also, make sure that you do this for all the quality settings you want to test your app with, as it changes from one to the others.

yes, of course I tried that setting. What it does is that it allows your game to run a frequencies above the displays refresh rate, but the actual rendered output is still v-synced.

Here’s a little demonstration, both in the editor and the build as well as on a devkit. On the left you see frame markup for FCAT and on the right you see frame numbers from 0 to 15, that are set on each update. Frames take about 1 to 2 ms to compute resulting in a massive number of dropped frames.

On the other hand, here is a video captured from a dev kit, where we actually can force vsync off. This is the expected and desired output. I can now use FCAT to measure the actual frame time at the end of the pipeline.

It seems that unity allows the game to run unthrottled by just simply dropping frames. But after all, we might not entirely blame unity here, my initial search (as mentioned above) hints that the fullscreen mode is to blame, which simply only allows vsynced updates.

push, push,… Happy new year everyone! :smile:

Yes, those VSync spikes seem to happen on multi monitor setups at least when in the editor. Unfortunately this also automatically affects setups with VR glasses attached. It’s been there for a long time and it is influencing the VR experience when running from the editor today. Maybe it would be good to create a feature request to improve the VSync on multi monitor setups. Disabling VSync doesn’t change anything for the spikes seen in the editor.

1 Like