Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

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?

share|improve this question
    
It will reduce a framerate under 60 Hz to 30, which is below the monitor's refresh rate. –  user56 May 26 '11 at 18:11
2  
@Arda Not always true. See Triple Buffering. –  DrFish May 26 '11 at 19:02
    
@Bora With DirectX (used by 99% of Windows games) it is always true. –  user56 May 26 '11 at 19:14
1  
Triple buffering will allow for increments such as 45hz. –  horatio May 26 '11 at 19:32
1  
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. –  pingbat May 27 '11 at 2:05

1 Answer 1

up vote 9 down vote accepted

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.

share|improve this answer
1  
It is incorrect to say that vsync introduces/requires double buffer (aka a 2nd buffer). –  horatio May 26 '11 at 19:38
    
There, I was more specific. Apologies for the previous laziness :-| –  pingbat May 26 '11 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. –  pingbat May 26 '11 at 22:04
    
+1 for the last sentence :O –  BlueRaja - Danny Pflughoeft Oct 31 '11 at 22:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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