14

I'm often encountering very strongly held opinions among games about the Vertical Sync (VSync) option present in nearly all modern 3D games. The option is supposed to synchronize the output of the game to the monitor refresh rate and thereby prevent tearing of the images.

Some say it causes lag, others say one should enable it because it looks better and doesn't hurt anyway. I've also heard that it reduces the framerate in general, not just when the framerate would be limited by the monitor refresh rate.

So, what are the technical disadvantages of VSync? What valid reasons exist to disable it in a game?

6
  • It will reduce a framerate under 60 Hz to 30, which is below the monitor's refresh rate.
    – user56
    Commented May 26, 2011 at 18:11
  • 4
    @Arda Not always true. See Triple Buffering.
    – DrFish
    Commented May 26, 2011 at 19:02
  • 2
    Triple buffering will allow for increments such as 45hz.
    – horatio
    Commented May 26, 2011 at 19:32
  • 3
    As detailed below, triple buffering allows for all possible framerates. If your refresh rate was 60Hz and you had triple buffered VSync enabled you could conceivable get a draw rate of 59Hz, dropping only one frame per second. In a double buffered system you might get 30Hz instead due to the 'dead time' while the buffers are full.
    – mjmdavis
    Commented May 27, 2011 at 2:05
  • 2
    @Arda: Not true, see pingbat's answer below (and comment above). And even if you are not using triple-buffering, that statement is only true if the redraw latency is consistently above 1/60th of a second (which is often not the case). So even with double-buffered VSync, any framerate is possible. Commented Oct 31, 2011 at 22:39

3 Answers 3

14

This forum post explains VSync in as much detail as you could ever want.

http://hardforum.com/showthread.php?t=928593

The gist of it is that VSync stops screen tearing.

Screen tearing occurs because the frame buffer is half filled with the next frame when it is written to the screen. VSync introduces a back buffer inbetween the video card and the frame buffer which stores the next frame and then waits for the screen to refresh before copying itself to the frame buffer. The refresh signal is known as a VSync pulse (from analog). This stops the tearing from happening but can lead to a significant reduction in video performance in certain situations. These situations arise when framerate drops below refresh rate. In these situations your performance can drop by up to 50% in the worst case.

Triple Buffered VSync improves upon double buffered by adding another buffer and results in a much smaller performance penalty. In fact you will see frames as soon as the card can draw them (still timed with refreshes) because the card never has to sit idle, it always has a buffer it can write to. The only penalty is a small loss of VRAM to hold the buffers and the extra time taken to copy them out to the frame buffer. This is negligible.

Only worry about VSync if you are getting screen tearing. Don't worry about enabling it on a triple buffered system. If it is only double buffered then it's a personal choice, a tradeoff between refresh rate and tearing.

For the more interested:

Technically VSync does not require a second buffer. In situations where rendering the screen takes only a fraction of the time between refreshes VSync pulses can be used to time the writing of new information to the screenbuffer. If render time < refresh interval.

When you play a game the time taken to render is much greater. Writing the buffer on the VSync pulse would result in tearing whenever render time > refresh interval. The second buffer prevents this screen tearing from taking place but means that you can be looking at the same frame over several refreshes. It also means that once the back buffer is full there is no place for the card to write the next render until the VSync happens. This means that in practice VSync in a video game always introduces extra buffers.

Adding the third buffer gives the card a place to write the next render once the back buffer is full and awaiting the refresh.

This knowledge comes from programming display drivers for embedded systems.

6
  • 1
    It is incorrect to say that vsync introduces/requires double buffer (aka a 2nd buffer).
    – horatio
    Commented May 26, 2011 at 19:38
  • 1
    There, I was more specific. Apologies for the previous laziness :-|
    – mjmdavis
    Commented May 26, 2011 at 21:50
  • horatio, triple buffering allows for framerate to be any integer, it does not impose increments like double buffering as the card is never idle.
    – mjmdavis
    Commented May 26, 2011 at 22:04
  • The post from the link keeps saying that, when double or triple buffering is used, data are copied between them and that causes waiting. Aren't the buffers just switched with each other? Back buffer becomes front and vice versa. In other words the screen alternates between the two buffers, which I guess happens almost instantly. Commented Jun 8, 2016 at 13:57
  • I guess this depends on your implementation. There are also several layers of abstraction so what happens in practice is not necessarily what happens in the basic theory.
    – mjmdavis
    Commented Jun 9, 2016 at 6:01
68
+50

V-Sync is short for "Vertical Synchronization"; its only purpose is to avoid screen tearing in games.

What is screen tearing?

Image depicting a simulated tear Image by Vanessaezekowitz, via Wikimedia Commons. Used under the CC-By-SA 3.0 license.

Screen tearing happens, because your GPU sends a frame to your screen when the latter hasn't yet finished displaying its previous frame. You are essentially seeing part of one image and part of another at the same time. Since both images often look very similar, it looks like the picture has been torn apart, hence the name "screen tearing".

V-Sync ensures the GPU doesn't send a frame while the screen is busy. There are various ways to achieve this. The most well known use double buffering or triple buffering.

When using double buffering, the GPU uses two frame buffers; the "front buffer" in which it stores the frame being sent to the screen, and the "back buffer" in which it stores the next image to be displayed.

Unlike double buffering, triple buffering uses two back buffers. Once the GPU is done with the next frame, it can start working on the second back buffer. If the screen still isn't ready by the time the GPU has filled both back buffers, the GPU can now safely overwrite the first back buffer. The advantage of this, is that it reduces the lag mentioned in point 2 (see below). The disadvantage, is the higher memory requirement of having one additional buffer, as well as higher power consumption and heat dissipation from constantly being under full load.

Recently, a new technology has been introduced intending to replace V-Sync: G-Sync (Nvidia) and FreeSync (AMD). Just like V-Sync, their purpose is to eliminate screen tearing, but now the screen will wait for the GPU, if the latter can't provide frames fast enough, essentially eliminating point 3 below.


From a gamer point of view, V-Sync does the following:

  1. It eliminates screen tearing. At least it should; I've seen games with buggy V-Sync where turning this option on did not remove tearing entirely.

  2. It introduces stuttering, or lag. Since your GPU now has to wait for the screen to be ready, the frame you'll see on screen will almost never be the most up to date. Most people don't notice it and/or find the screen tearing to be worse distraction than the former.

  3. It will affect your framerate if your GPU can't match your screen's refresh rate. For instance it'll try to feed a 60 Hz screen with one frame every 16.6 ms (1/60 second). If it can't produce a frame fast enough, it'll have to wait for the screen's next refresh cycle before it can display it. If this happens frequently, i.e. your GPU can't provide frames every 16.6 ms, then your effective frame rate will drop sharply from 60 to 30 (1/2) to 20 (1/3) to 15 (1/4) etc.

As a rule of thumb:

You want to turn V-Sync ON if:

  • You experience screen tearing and want to eliminate it.
  • You want/need to limit your framerate for whatever reason and the game does not have a frame limiter. Possible reasons include:
    • You want to reduce your GPU's power consumption.
    • You need to reduce your GPU's heat dissipation.
    • You want to avoid physics bugs that can happen at high framerates.

You want to turn V-Sync OFF if:

  • You want the highest framerate possible. E.g. you're benchmarking or stress-testing your GPU.
  • You want the lowest possible input lag. E.g. you play competitively.
  • You don't care about the screen tearing, or it is not noticeable enough for you to care. Owning a high-refresh screen (anything above 60 Hz) helps make screen tearing less noticeable.
  • The game's implementation of V-Sync doesn't work and you still experience screen tearing nonetheless.

Notice that some modern games have frame limiters, so even if you turn V-Sync off, you still can't achieve higher framerates and may still experience input lag. Also note that while V-Sync may act as a frame limiter, frame limiters do not eliminate screen tearing on their own.

4
  • 2
    @KevinKrumwiede. The FreeSync article describes this well enough. Simply put, most screens display a frame once every 16.6 ms (60 Hz screens), so if the GPU takes like 18 ms to render a frame, it'll have to wait an extra 15 ms before it can send the frame to the screen, thus waiting 33 ms in total for 1 frame (30 FPS). With G-Sync/FreeSync, the display will wait for the GPU, so instead of seeing a frame for 33 ms, you'll see it "only" for 18 ms. The lag is thus much shorter.
    – Nolonar
    Commented Dec 27, 2014 at 23:04
  • 2
    By the way, if I understand it correctly, the image from the AMD page you linked suggests V-Synch will not necissarily halve FPS, but instead skip frames when it needs. Or did I misunderstand their explanation or the answer?
    – Jeroen
    Commented Dec 28, 2014 at 10:06
  • 2
    Screen tearing is the bane of my existence. It makes my eyes bleed. If I had an OCD, it would be about screen tearing. Please people, keep your eyes safe from screen tearing and practice vSync!
    – k1DBLITZ
    Commented Dec 29, 2014 at 20:51
  • @k1DBLITZ You should try Skyrim with no VSync. You won't be worrying about the VSync when you see what happens.
    – user92092
    Commented Dec 30, 2014 at 1:42
3

VSync is a feature that affects your FPS (Frames per Second). Instead of wasting power trying to achieve a higher FPS than your monitor can handle, it detects the refresh rate of your monitor, (in my case, 60 Hz), and then automatically restricts your FPS to that number. So if you have multiple monitors, and you use Minecraft between them, by using this feature, you can easily get the best frame quality, that is, if your computer can handle it. You can read more here: https://minecraft.wiki/w/Options

Edit: Yes, after reading your post again, tearing will occur if you set your frame rate above the refresh rate of your monitor. Setting VSync is the best way to avoid this.

1
  • Setting the frame rate above the monitor refresh rate will not cause tearing, it just wastes resources as superfluous frames are dropped. You will also get a much fresher frame on average. Lowering it will also give you more time for AI or fancier rendering..
    – mckenzm
    Commented Jun 16, 2017 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.