Skip to main content
Up and Coming
September 4, 2013

Unity troubleshooting latency notes

I have my nvidia graphics card setttings to always NOT wait on vertical sync. My opinion is that simulator sickness is worse than tearing artifacts. Personally I don't notice tearing unless I am explicitly looking for it. I may not always visually notice latency when not looking for it but I do risk feeling additional latency and not being able to play as long.

Someone that played my VRJam game provided some feedback that the game felt slow and that resulted in him not feeling well. I started to investigate this by playing with vertical sync and some other settings (since I don't know how others have their graphics card configured). Unfortunately I found for Unity, turning vsync on adds significant latency. Of course some latency is expected when waiting on vsync but it is looking like about 3 frames or ~50 milliseconds of additional latency (60 Hz update rate when waiting on vsync, ~80 Hz update rate when not waiting on vsync). 50 additional milliseconds of latency in an HMD is very noticeable and makes the game difficult to play for long without feeling nauseous.

I also found the following line in OVRCameraController.cs that gets called if you have Edit->Project Settings->Quality set to "Fantastic".
QualitySettings.vSyncCount = 1;
This means that if you have your graphics card vertical sync settings to "use the 3D application settings" then you will wait on vsync even if you set within Unity Edit->Project Settings->Quality->Vsync Count to "Don't Sync". In other words for the "Fantastic" setting the Unity UI vsync setting is ignored. Because of this I comment out the above line of code so the "Fantastic" Unity UI vsync setting works as intended. This wouldn't be that bad if 0-1 frames of latency latency was added as should happen when waiting on vysnc but ~3 frames of latency is very bad. I also played with the QualitySettings.maxQueuedFrames but could not see a difference.

I also played with the nvidia setting "Maximum pre-rendered frames" that I previously had set to "Use the 3D application setting". I found when I set this to "1" (and waiting on vsync) then there is less latency but some form of jitter occurs when moving your head. Setting it to "2" or higher results in smooth movement but more latency. Not waiting on vsync with the max pre-rendered frames set to 1 results in low latency with no jitter.

It is possible that some of these issues may be specific to my computer/environment. I am using the following:
1. Windows 7 (Windows 7 Basic theme since the Windows Aero theme adds a frame of latency)
2. Unity 4.2.1
3. Nvidia GTX 680m (Triple buffering off)
4. Tested with both single monitor and dual monitors without noticeable difference
5. DirectX 11

Is anyone else experiencing similar or related latency issues on other systems? This seems like a major risk of users getting sick, especially once we all start shipping to users that don't understand latency or have their graphics cards settings optimized for VR.

Jason
    This topic has been closed for replies.

    12 replies

    Inspiring
    December 21, 2013
    Ah, I'd better clarify that the above tests were done in a Unity project without DX11 turned on (DX11 is not enabled by default.)
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Up and Coming
    September 16, 2014
    The problem is still there. Unity has considerable higher latency when compared to UE4. In UE4, head motion is already instantly translated in new pictures, with Unity it feels I'm a little drunk or something.

    Is there anything we could do against it?

    spyro