cancel
Showing results for 
Search instead for 
Did you mean: 

DX11 related lag

Curtis
Explorer
Lately I have run into a really big problem. Stomach churning, throw the rift off my head, reach for a bucket, awful lag and it has nothing to do with the frame rate.

There is no choppyness associated with this lag, if anything head tracking goes "extra smooth". For instance, if you roll or nod your head, the camera lags behind, to the point where you can almost get the camera to stay stationary why your are rolling/nodding (and if you do it to much.. reaching for a bucket).



The two times I have noticed it was 1) I had loads of particles on screen, forward rendering. The weird part is, I had equal amounts of particles in all direction, but the horrible lag only occurred when I looked in one direction. If anything, there where less particles where the lag happens...


2) Point light, deferred lighting. Lots of calculations here, lots of shadows being thrown around, but zero drop in frame rate, just this horrible smooth lag.


Is it just me?

Any help fixing this, or at least ways to avoid it would be greatly appreciated!

Thanks

edited to make the subject line more relevant to the topic
18 REPLIES 18

cybereality
Grand Champion
Do you experience the same "lag" if you use other input (mouse/keyboard/gamepad) or is it only effecting head-tracking?

Curtis
Explorer
It appears to only effect head tracking. I am also using hydras, and I can move those around in front of me with almost no lag in the trouble spots, as long as I hold my head still.

So this time, I intentionally got the frame rate to dip from 60 fps to 50 fps, and a tiny bit of lag on hand movements, but it is like you would expect. The bad news is that it made the head tracking lag MUCH worse, it is unbearable

I should also say that 95% of the time everything works fine, and when there is framerate dips the rift reacts like you would expect with <60 fps. Normal choppyness. But this problem seems to be pretty different

cybereality
Grand Champion
Are you using DirectX11? I remember some people experiencing lag with DX11 and Unity.

Curtis
Explorer
Yep, using direct X11.

Later on, I'll back everything up, and try it without 11.

In the long run, that is a bad solution for me though, because I am using tc particles (which requires dx11)

But still, Ill try it out just to see if that is the problem

Anonymous
Not applicable
I have same issue with DX11. The only solution I have found and read about is to turn vsync off. You must turn it off in both quality settings and edit OVRCameraController.cs to turn it off. Code snippet below:

		//QualitySettings.vSyncCount = 			1;


I really hope there is a fix to this soon (I'm not sure if it is a Unity DX11 issue or a Rift SDK issue). I also depend on DX11 and I have to choose between unacceptable latency that will make people ill or reduced visual quality due to tearing. Not a good choice.

I have the latency tester and I found it registers 60ms with vsync on and 20ms with it off. The difference is huge in terms of head response (I can see why VR failed in the past). FPS is pegged at 60FPS with vsync on and ~110FPS with vsync off.

DX9 with vsync on doesn't have the same issue.

I have tried many things to eliminate latency with DX11 with vsync on and none seem to matter. Driver settings don't seem to make a difference (except the one that forces vsync off).

Here is another thread that talks about this:
viewtopic.php?f=37&t=5594

ccs

Anonymous
Not applicable
I figured out the issue!

It appears to be a Unity bug with DX11. Essentially QualitySettings.maxQueuedFrames is not working with DX11. It doesn't matter what you set it to, the latency result is always the same. I filed a bug on Unity to see if they can fix it.

Fortunately there is a workaround (at least for Nvidia cards). I have an Nvidia GTX 760 and in the driver there is a setting that overrides application max queued frames setting.

I ran some tests with my latency tester just to verify what my eyes and brain were telling me, and it is pretty clear this setting fixes the issue and shows that QualitySettings.maxQueuedFrames is not functional in DX11 (seems to work fine in DX9).

Application     Nvidia driver max frames        QualitySettings.   latency  latency  latency avg
maxQueuedFrames low high 10 runs
vsync off Use the 3D application setting 0 9 44 21.3
vsync off Use the 3D application setting 5 10 49 24.9
vsync off 1 0 11 34 19.8
vsync on Use the 3D application setting 0 18 79 53.6
vsync on Use the 3D application setting 5 16 71 41.1
vsync on 1 0 9 32 16.2


Attached is a picture showing where the override setting is in the Nvidia driver.

NvidiaMaxPreRenderedFrames.png

ccs

Curtis
Explorer
Awesome, thanks for this info!

I just tried my project out with Direct X11 disabled, and sure enough, that fixed the problem.

Turned dx11 back on, disabled V sync like you suggested and... WOW! What a HUGE difference in latency, not only with the trouble spots, but just in general.

One thing, I am now getting around 100 - 120 fps so I through in a

	Application.targetFrameRate = 60;


just to keep things consistent.


Thanks again, this is some excellent info!

cybereality
Grand Champion
Interesting. This sounds like it's not a bug w/ the SDK itself, but I will have someone take a look to see if there is any way to mitigate the issue.

Anonymous
Not applicable
Nice! that worked for me, i switched it to 1. Thanks! it's so nice to have the correct tracking.