After reading Mr. @L Spiro's excellent article on fixed timestep, I was convinced that my own implementation was incorrect, suffering from very occasional frame skip. After looking closely at the numbers, I found one source of frame skip. Every 40 seconds or so, I get an extra Draw(), at the cost of an Update(). It occurs when the interpolation factor approaches 1. It's not always visually discernible.
I'm drawing at 144Hz (not ideal, but the only refresh rate supported by this display) and my update rate is set to half that.
Adding a dozen or so ticks to the accumulated time each loop iteration fixes the issue, but that's not a fix.. it's a hack.
FrameTime = Timer.ElapsedQPCTicks;
Accumulation += FrameTime;
//
// Update
//
while (Accumulation > UpdateTicks) // @72hz UpdateTicks = 138888
{
Update(UpdateTicks);
Accumulation -= UpdateTicks;
}
//
// Draw
//
Draw(Accumulation / (double)UpdateTicks);
Swapchain.TryPresent(DXGI.PresentFlags.None, 0, null); Values shown are Int64/Long
Any guidance would be gratefully received. Thanks in advance. ?
-- ROGRat