Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

if you have 0 input delay, worst case latency is still 32ms, because your input might come in when back frame is ready, but blit hasn't happened yet: render frame A, input comes in, blit frame A, render frame B, blit frame B.

but your input delay is not 0, so your input might come in before frame A above, but frame A doesn't reflect input yet, which makes your worst case input latency 48ms: input comes in, blit ..., render frame A, blit frame A, render frame B, blit frame B.

there are also bad vsync implementations, that by virtue of being enabled, introduce further delay between state and graphics. or if fps drops under refresh rate, things go out of sync, and your vsync becomes a compounding effect.

finally vsync delay existing in addition to whatever other delays. a 30ms delay for whatever reasons, becomes an 80ms delay because vsync on top.



Here's how I see it:

99% of the time a game after 1998 or so says "vsync" it means double buffered vsync, so I'll explain that version.

Let's say the game renders frames instantly.

Without vsync but locked at 60FPS, an input can take up to 16ms to cause an effect on the monitor because the game loop only applies and renders pending inputs once every 16ms at this framerate. Each input will have between 0ms and 16ms of lag.

In double buffered vsync at 60Hz, its the same thing: the game loop applies and renders pending inputs once every 16ms. But now the frame is not shown on the monitor right away. Instead, the loop waits for the monitor to be ready. And because the loop will restart right after that, this wait will always be another 16ms. Each input will have between 16ms and 32ms lag.

Of course if your render takes more than 16ms you will have more issues, but that's not the problem here. Even with a computer that renders instantly, the lag will be too much.

And yes this will be on top of the already existing lag of the game and peripherals.

I don't understand how you get 48ms. If I have a mouse with 4ms of lag, it will just add a constant 4ms to the total making worst case 32ms + 4ms. I did think it was 48ms at some point but now I think I just imagined it.


you're right, I fucked it up with 48ms logic. an input lag will go to a second 16ms cycle instead of the first one, rather than somehow magically creating a third one




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: