Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate frame timing with v-sync enabled #76

Closed
DuFF14 opened this issue Sep 21, 2015 · 0 comments
Closed

Investigate frame timing with v-sync enabled #76

DuFF14 opened this issue Sep 21, 2015 · 0 comments
Assignees

Comments

@DuFF14
Copy link
Member

DuFF14 commented Sep 21, 2015

Ideally we want to be updating our poses as late as possible before rendering (see http://docs.unity3d.com/Manual/ExecutionOrder.html). We're currently doing this in DisplayController::OnPreCull (https://github.com/OSVR/OSVR-Unity/blob/master/OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs#L212).

When examining some event traces with v-sync off, timing looks reasonable -- we get pose state just before rendering starts, with fresh tracker data arriving just before that.
image

With v-sync on, our updates look like they're happening at the wrong time. Here you can see the GetState calls are happening after rendering has already started.
image

Taking a look at the Unity profiler indicates that with v-sync on, a lot of time is spent waiting (WaitForTargetFPS). It would be helpful to know when this waiting occurs in execution order, and if it's possible to keep updating in the background while waiting. I have an open question on this: http://answers.unity3d.com/questions/1068128/when-does-waitfortargetfps-actually-wait-in-execut.html

Does anyone have insight into this v-sync problem or see some possible solutions?

More event traces: http://imgur.com/a/uQDed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants