If you are a gamer, surely you know the Vsync or vertical sync settings that you see in the graphics settings of the games. It is also very likely that you have heard that its activation causes the so-called input lag, but what are both concepts really? What are the advantages and disadvantages of Vsync, and is it worth it?
In this article, we will start by reviewing what Vsync is and what it seeks to solve (tearing ) and what input lag is, to later analyze if it really causes this effect. Let’s get started.
Vsync: All You Need to Know
What are Vsync and Input Lag?
The tearing effect is one of the most hated in games. Basically, it consists in that we notice how some frames are “cut off”, in such a way that we can notice how from a certain point on the screen we see the image slightly displaced, especially when it comes to moving objects. Activating Vsync fixes this, but activating it is said to cause another effect, increasing input lag.
So, we are going to start by defining what Vsync is and what its fundamentals of operation are, to then define input lag and finally be able to answer all your questions about the topic.
How Vertical Sync or Vsync Works to Reduce Tearing?
When our graphics card generates a frame, it is sent to the so-called framebuffer, a region of its memory in which it stores the information of each pixel of the frame, to later be read by the driver of our monitor, which will show the corresponding frame on the screen.
As you know, all monitors have a specific refresh rate, that is, the number of times they show a new image per second. In most cases it will be 60Hz, which translates to a new frame every 16 milliseconds (1/60).
On the other hand, when we are running a game we will do it at a certain FPS rate, let’s say we are varying between 100 and 120 FPS. This means that there will be a new frame in the frame buffer after 8 to 10 milliseconds.
Well, where is the problem? Very simple: if it turns out that the monitor needs 16 ms to print the entire frame, then the framebuffer update can coincide in the middle of screen printing, just when the monitor is accessing this memory space.
If this happens, then what we will see on the screen at that moment will be part of one frame and part of another. That is exactly the phenomenon of tearing.
Well, the idea behind Vsync is to get the graphics to only send new frames to the framebuffer when the monitor has completely finished the previous refresh cycle, and is therefore ready to print a new one. This is achieved by combining two actions:
- Synchronize the FPS rate with the monitor refresh rate.
- Synchronize the time of sending the frames. Having the same FPS as Hz is not enough, because we could be generating the frames in the middle of the printing process and not right at the beginning, so we would not avoid tearing.
The second point is essential for the Vsync to work as it should, since if we do not take care of that synchronization then we could be changing the framebuffer when the monitor is half way. So, not only would we not have solved the problem but it would be much worse, since there would always be the same desynchronization and therefore the same tearing.
What is input lag and how does it affect us?
Input lag defines the time that elapses since we send a signal to the PC (such as moving the mouse) and seeing the changes on the screen. It especially affects those players of competitive titles, particularly shooters, where having greater input lag implies that we will take more delay between our actions and what happens in the game, making it more difficult to play correctly.
Double and triple buffer
As explained earlier, it appears that there is only one framebuffer on the GPU, and this is usually not the case. We were referring to the one accessed by the monitor for drawing on the screen, but normally there are at least two buffers, the front and the rear. Basically, what happens instead of the simplified explanation from before is that at each moment the GPU modifies only one buffer (the rear one), while the monitor reads the other one (the front one). When the GPU finishes writing, it does an instant swap of both. It does not copy them or anything like that, but the memory space that corresponds to the front buffer becomes the rear and vice versa.
This is basically done to avoid flickering or flickering problems, after all, it does not seem like a very reliable solution to read something at a specific rate while it is being updated.
Well, the big problem with Vsync is that this exchange of framebuffers can happen at any time, as we explained at the beginning, the information of the frame to be printed can change just while it is being printed, and hence comes the tearing effect. With VSync enabled, there is no exchange of framebuffers until the monitor has finished each refresh cycle, and generation occurs in sync with that rate.
In this sense, a triple buffer can be used for the Vsync, in such a way that there are 2 rear framebuffers, with the motivation that the graph can work at a less weighted pace, for a very simple reason: during the few milliseconds where the back buffer is waiting to be swapped, time is wasted. By adding the triple buffer, we allow the graph to already generate another frame in the third buffer while the second one waits for its exchange.
Does Vsync cause input lag?
The answer is YES. Let’s see why. Vsync works by interrupting, not by polling. This basically means that the synchronization does not consist of operating at a specific frequency and that’s it, but when a frame is generated it waits for a signal to be received to proceed to the drawing of the next frame.
So basically the graph will have to be “waiting” for the monitor to finish displaying each frame before starting to generate a new frame.
In this regard, the response from the community is unanimous: these differences in input lag are more than enough to be noticed in games. As we explained before, you will understand that the triple buffer Vsync is much better in this regard, but that does not mean that it is perfect.
This is not something that can only be reasoned and seen from a theoretical point of view, but it can also be measured
So should I forget to activate it or are there cases where I could use it?
It is clear that, in view of the above, using vertical synchronization in games that require good reflexes and fast movements, such as a shooter, is a bad idea. In fact, it is normal to notice very palpable differences and even worse, playing with Vsync activated. The extra delay it adds can be critical.
But, on the other hand, it is not that it seems a bad idea to use Vsync in more relaxed games, as it could be some more based on the story than on the action, or where the added latency will not be a big problem even if there is speed, as it could be a driving simulator.
The problem is that input lag doesn’t have to be the only effect of Vsync. It can also be the case that, if the synchronization between the graphics and the monitor is not too successful, FPS drops are caused which in turn cause stuttering, which is also an incredibly annoying effect and affects fluency very strongly. Everything will depend on the specific title and the situation, of course.
What are the alternatives to Vsync?
Sure, if Vsync isn’t the reasonable solution to tearing elimination, will we be forced to deal with this problem, or are there better solutions? Fortunately, there are quite a few options available.
The star technology is the variable refresh rate (VRR), which we find implemented in AMD Freesync and NVIDIA G-Sync. This basically allows us to get the monitor to vary its refresh rate and this is synchronized with the frametime of the running game, that is, the image is refreshed every time there is a new frame. Thus, we achieve a tear-free experience without weighing down the Vsync.
We have more options that make us forget about input lag, such as limiting the FPS, but as we explained in our article about it, this does not work, because we do not ensure the synchronization in time that we talked about before.
Vsync or vertical synchronization is a technology that allows the graphics card to synchronize the sending of the rendered frames with the monitor, in such a way as to avoid the annoying effect of tearing in games.
This effect, which produces “choppy” frames, occurs when the monitor reads part of one frame and part of another. To print each frame per screen, a memory region containing all its information is read. If a new frame is generated while reading, it will overwrite the previous one and that is when the tearing will appear. This is what Vsync comes to solve.
Synchronization is achieved both in the number of frames sent (there will be as many FPS as the monitor’s refresh rate in Hz) and when it is sent, since the graph will only send them for drawing when the monitor has finished the previous refresh cycle.
Sure, this is very effective and wonderful to eliminate tearing, but it introduces two additional effects: on the one hand, we have the possibility of FPS micro-drops that cause stuttering, something that affects the fluidity of the game in a horrible way. The other effect is the input lag, which increases considerably with the activation of the Vsync, and is basically the delay that occurs from when we move our mouse or press a key until the changes are reproduced on the screen. This is devastating in games with fast and agile movements that require good reflexes, for example in a shooter.