Skip to content

Investigate frame timing with v-sync enabled #76

Closed

Description

@DuFF14

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions