I’ve been working in OpenVR (the Steam API), and every once and a while I will get some judder. Is there a way to detect exactly what frames juddered/when juddering will occur? I’d like to minimize this, and I can change processing of my application dynamically based on how much judder might occur (to make things run faster to prevent judder), but I need some way of “profiling” the judder.
I’m in Unity, but I’m doing all my processing on the graphics card (using a Compute Shader), so the profiler says the framerate is very fast, yet sometimes judder occurs. I thought maybe taking the maximum frame rate over, say, 5000 frames might work, but sometimes judder occurs when the maximum hasn’t changed. So is there a way I can actually measure it?
It turned out that Unity 5.4 has VRStats.gpuTimeLastFrame which was exactly what I was looking for.
Edit: For those that are interested, it turns out that that “detecting spikes” method isn’t actually relevant for detecting judder. Here is a plot to see why:
Where the x axis is frames, and the right axis is the ms value returned by VRStats.gpuTimeLastFrame. To generate this plot, I found somewhere that I had a very high amount of judder, and somewhere where I had no judder, and moved from the non-juddery region to the juddery region and back.
As you can see, the gpu times vary a ton, which means that measuring spikes will give you very little data about judder. Instead, judder occurs when there is simply a lower framerate. While it seems that judder is these “spikes” of lagging movement, it’s actually consistent when you have a lower framerate and is happening even if your head is still, you just only experience it when your head is moving.
Thus, the best way to measure judder is simply to look at the fps (of sorts) of this gpu value, and then if it is above about 6 ms (this is something you can play with) you will most likely experience judder.
You mean jitter? Never heard it called judder before.
Your basic premise is correct, but 5000 frames at 60fps is nearly an hour and a half, so that might be too long. Any bumps would be averaged out. I would use 60 or 120 frames for averaging.