Originally posted by: SPARTAN VI
Originally posted by: Trevelyan
Um no.
Triple buffering fixes that problem and will output 50fps even with vsync on.
Beat me to it.
Originally posted by: garkon8
Hey, thanks for all the replies and crash course on v-sync. But, please explain to me how I can get 82.0 fps with vsync-off and 53.8 fps with vsync-on in Doom3. If I'm understanding your logic, turning v-sync on caps your fps at your monitors refresh rate, correct? If my fps are capped at 75 (my monitors current refresh rate), than should I not still be able to get up to 75 with vsync-on?
Monitor: Viewsonic Ultrabrite A90f+ (sweet CRT) current refresh rate 75htz
Doom3 at 1280x1024 high quality settings:
vsync-off 82.0 fps
vsync-on 53.8 fps
I still hold true to my belief that vsync-on looks better than off; I'm using the "saw it with my one eyes" defense.
Simple. Sure you can hit 82fps with vsync off, but that does not mean you're at a
constant 82fps.
Constant being the uber-key-bolded-word here. You could be staring at the floor in CS:S and hitting 100fps, look up and get into a gun fight, then you're at 20fps, no wait, 21, no, 29, oh no someone else jumped in, 14, everyone's pwnt so, 30... Your framerate is constantly changing.
When v-sync is enabled, you're not just "capping" your framerate at your monitor's refresh rate; v-sync does its work by both syncing with your monitor's refresh rate, and sustaining a constant framerate. For instance, traditional vsync tries to hold onto 60 frames per second. If it cannot sustain that constant 60 frames per second, it'll drop it in half, 30fps. If it still can't hold onto 30fps, down to 15. The aforementioned
triple buffering is a neat feature that allows us to vsync without halving our performance ( double buffering). Instead of dropping by halves, you'll drop by thirds. Instead of 60-30-15, it'll go 60-40-20 (assuming you're at 60Hz).
This is, basically, not very accurate.
With double buffering, your video card has to stop rendering whenever the backbuffer is filled and the monitor is not ready to refresh yet. With triple buffering, it can flip to the third buffer and start drawing the next frame there, and then when the monitor is ready to display, it takes the next available frame.
With double buffering, you can still have 'intermediate' frame rate values -- but usually you'll get into a state where the video card is too slow to fill a frame in a single refresh cycle, and then it will end up only being able to use every other cycle. If it's too slow to get every other cycle, you might get every third, or alternate between two and three refreshes per frame. If you get into a situation where your card is *sometimes* able to draw over the monitor's refresh rate, but sometimes not, the framerate will 'stutter' between, say, 60 and 30FPS many times per second, which creates annoying visual artifacts around moving objects (they seem to not move smoothly).
With triple buffering, it gets more complicated. With three buffers, your video card is more likely to be able to render almost all the time. For instance, if you are running at 100Hz (so it takes 10ms per frame), and your video card can render at 67FPS (so it needs ~15ms per frame), you'd get a result sort of like this:
time (ms)
0............10............20............30............40............50............60............70............80............90............100
xxxxxxxxxxxxxxxxxxxx11111111222222222222223333333344444444444455555555666666666 (frame being displayed)
1111111111122222222222333333333344444444444455555555555666666666xx77777777 (frame being rendered)
In this case, three out of every four frames were 'new' (which makes sense, since it is rendering at 3/4 of the refresh rate), and the card was able to render more or less continuously. If you took this out long enough, you'd end up with close to 75FPS being displayed.
With double buffering, it would look more like this:
time (ms)
0......10......20......30......40......50......60......70......80......90......100
xxxxxxxxxxx111111222222222233333333333444444444445555555 (frame being displayed)
1111111112222222233333333xx444444444xx555555555xx6666666 (frame being rendered)
In this case, you can see that every frame is going to be displayed twice, and the video card is going to sit idle for a short time at the end of rendering each frame (because it doesn't have the third buffer to start drawing into). But if you had a mix of frames where some of them took less time to render than the refresh rate, you might end up with an overall framerate of, say, 70FPS over time.