V-sync with maxfps 60 is way smoother
YoungTrotsky
Join Date: 2007-03-09 Member: 60307Members
Not sure if this has been discussed before, I tried a quick search and didn't turn anything up but apologies if this is old news. I don't like playing with v-sync disabled as I get tearing and it bugs me, with v-sync on I am aware there can be some input lag but I haven't noticed a significant difference. I have a 60Hz LCD monitor and pretty high-end machine so with triple-buffered v-sync enabled I get a constant 60 fps except in the busiest of fights.
What I have noticed is that despite a constant 60 fps I was getting pretty high numbers in the 'waiting for gpu' line of r_stats. This seemed strange as I'm pretty sure my graphics card is not bottlenecking at 60fps with everything turned to low. I tried setting maxfps 60 in console and voila - 'waiting for gpu' is now locked at 0ms all the time, except on those rarest of occasions when fps drops below 60.
This isn't just a 'that number bugs me' problem either, the movement is way smoother than without the maxfps limit, even though fps is reported as 60 in either case. I don't know if this is some flaw in the way v-sync is implemented in NS2 that could be fixed, but I highly recommend anyone who prefers to have v-sync enabled to set maxfps 60 in console. Unfotunately it gets un-set on map change, the workaround I have come up with is to bind my 1 and 2 keys to maxfps 60 so that I will automatically set it without having to think about it whenever I change weapon, you could bind W or Space or Mouse1 but then the console gets spammed with "maxfps 60" over and over.
If anyone would like to shed some light on why this happens I would appreciate that information. Thanks.
What I have noticed is that despite a constant 60 fps I was getting pretty high numbers in the 'waiting for gpu' line of r_stats. This seemed strange as I'm pretty sure my graphics card is not bottlenecking at 60fps with everything turned to low. I tried setting maxfps 60 in console and voila - 'waiting for gpu' is now locked at 0ms all the time, except on those rarest of occasions when fps drops below 60.
This isn't just a 'that number bugs me' problem either, the movement is way smoother than without the maxfps limit, even though fps is reported as 60 in either case. I don't know if this is some flaw in the way v-sync is implemented in NS2 that could be fixed, but I highly recommend anyone who prefers to have v-sync enabled to set maxfps 60 in console. Unfotunately it gets un-set on map change, the workaround I have come up with is to bind my 1 and 2 keys to maxfps 60 so that I will automatically set it without having to think about it whenever I change weapon, you could bind W or Space or Mouse1 but then the console gets spammed with "maxfps 60" over and over.
If anyone would like to shed some light on why this happens I would appreciate that information. Thanks.
Comments
BUT you should know that a) maxfps was only intended as a debugging tool and b) while you may not notice any delay there definitely is one with triple buffering.
edit: should note that vsync has had wonky issues in the past like hitching etc. Will pass this on to Max to look over just in case.
OK thanks for your response. I assume that with maxfps uncapped the game actually still renders frames as fast as it can but selectively sends them to the buffer according to monitor refreseh rate, hence still getting 'waiting for gpu' values despite only having 60 FPS visible, but I don't think that explains why the picture is choppy with maxfps 0 and smooth with maxfps 60, or maybe it does and I'm just not knowledgeable enough on this subject to understand it.
I like that article you link to btw, but it actually doesn't really go over input lag, I found this one more useful for that: http://vsra.forumotion.com/t109-vsync-and-input-lag
loop
{
(1) if the GPU has buffered too many frames, wait for it to finish (display amount of time waiting)
(2) do game stuff
(3) if maxfps is set, wait until we hit the desired frame rate
}
So by setting maxfps, you're causing the game to stall at (3), which gives the GPU more time to process before it does (1). As a result, you end up not having to wait at (1) since you've already waited at (3).
I'm not sure why this would affect the smoothness of the game though. I'll have to think about that some more.
Double buffering wasn't that bad, but somehow this changed. maxfps right now does something weird and is much less smooth then when actually running at the same FPS. But hey its a debug tool not a game option :P
I think everything you say is correct, the downside to using vsync or just capping frame rate is that you get an input delay compared to if you just let the gpu send frames to the monitor as soon as they're ready. It isn't much (never more than 16.67 ms if you have constant 60 FPS) but it can potentially mess with your aim a bit. There is of course a certain unavoidable delay if your monitor refresh rate is lower than your maximum achievable FPS, but adding vsync or capped frames on top of this can exacerbate the problem. That's why some people choose not to use vsync and just put up with screen-tearing, it makes the game a bit more responsive.
That is my understanding at least, I am by no means an expert, and would welcome corrections if anyone knows better.