Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.

Difference between revisions of "Glossary:Vertical sync (Vsync)"

From PCGamingWiki, the wiki about fixing PC games
(→‎Override vertical sync (Vsync) behavior: strangle also works with vulkan)
(→‎Override vertical sync (Vsync) behavior: On Windows, in windowed mode)
Line 97: Line 97:
 
# Click on '''Apply changes''' to save the changes.
 
# Click on '''Apply changes''' to save the changes.
 
}}
 
}}
 +
 +
===Use windowed mode (Windows)===
 +
On Windows, when playing a game in [[Glossary:Windowed|windowed]] or [[Glossary:Borderless fullscreen windowed|borderless fullscreen windowed]] mode, Windows automatically applies VSync.<ref>[https://superuser.com/a/954330 ref 1]</ref><ref>[https://www.reddit.com/r/pcgaming/comments/6q7vn4/why_does_playing_in_windowed_mode_fix_screen/dkvleuv/?utm_source=reddit&utm_medium=web2x&context=3 ref 2]</ref>
  
 
{{References}}
 
{{References}}

Revision as of 10:47, 11 July 2021

For a list of games, see List of games that support vertical sync (Vsync).


Vertical synchronization is an option used to prevent screen tearing. Screen tearing is a graphical glitch which is perceived as straight horizontal lines across the monitor or as if the whole picture is stitched together by two or more separate pictures. This problem exists because the monitor and the graphics adapter normally works independently, so new frames may not be fully drawn when the monitor display them. Vsync makes the graphics adapter wait for the monitor to signal it's ready for the next frame to ensure all displayed frames are always fully drawn. This has the positive side effect of limiting the amount of frames per second the computer has to draw to the monitor refresh rate (the amount of frames per second the monitor is able to display) which saves resources. Unfortunately Vsync can also increase input lag.

Resources

Properties

Benefits

  • Eliminates tearing by waiting for the monitor to signal it's ready for the next frame.
  • Lower power consumption (and therefore heat and noise) by limiting FPS to what the monitor is able to display.

Disadvantages

  • Introduces extra input lag. Commonly experienced as "mouse lag". The higher the monitor's refresh rate, the less input lag there will be.
  • May decrease performance if FPS falls below the monitor refresh rate.

Limitations

  • Only available in fullscreen exclusive mode (a borderless fullscreen window does not qualify).
  • Not to be used when benchmarking since the FPS will be capped at the monitors refresh rate.

Double buffering vs. Triple buffering

With double buffering the GPU waits for the most recently rendered frame to get displayed before beginning work on the next frame. With the "older" form of triple buffering, the GPU starts working on the next frame after that in the third buffer and if that new frame completes first, that frame gets displayed next and the other frame in between gets discarded. However with most modern DirectX games, the "triple buffering" option is instead implemented as a sequential frame queue.[1]

Double buffering yields the most consistent frame rate while triple buffering can be slightly more responsive.
Nvidia's Fast Sync is an implementation for DirectX applications of the "older" way of doing triple buffering, where the oldest buffer would always be overwritten.[1] AMD's equivalent is called Enhanced Sync, and combines the triple buffering behavior with that of an adaptive V-Sync.[2]

Adaptive V-Sync

Adaptive V-Sync (late V-Sync, dynamic V-Sync) is Nvidia's name for their technology that dynamically toggles V-Sync behavior on or off depending on the frame rate. When the frame rate reaches or exceeds the refresh rate, vertical sync is enabled to eliminate screen tearing at the cost of higher input latency. When the frame rate falls below the refresh rate, vertical sync is disabled to minimize stuttering and decrease input latency at the cost of screen tearing.

The closest AMD equivalent is their Enhanced Sync technology that combines the adaptive V-Sync behavior with that of triple buffering for DirectX-based games.[2]

So what's the best option?

There is none and results will vary between different games, systems and people. If you're bothered by tearing or want the best visual quality, enable Vsync. If you're bothered by input lag or have performance problems, try Triple buffering for reduced input lag or completely disable Vsync for no input lag. If you're playing first-person shooters competitively, always disable.

Using frame limiting 1-2 FPS below the refresh rate in conjunction with Vsync can also be used as a more responsive (for as much as imperfect) tearing solution, although at the potential cost of introducing a periodic stutter.[3]

Note that Vsync should not be used only as an FPS limit. If you only want to limit FPS drawn, for example to minimize heat and fan noise, but are not bothered by tearing and don't want to risk input lag, simply limit your FPS to that of your monitor's refresh rate or close to it. An FPS limit is often an option available as an in-game console command or similar.

Override vertical sync (Vsync) behavior

Vendor agnostic solution

D3DOverrider (Windows, DirectX)
  1. Download and extract D3DOverrider
  2. Open D3DOverrider.exe.
  3. Create a custom profile for your game.
  4. Configure Force triple buffering and Force VSync as desired.
Force with dgVoodoo (Windows, DirectX 2-9/Glide)
Force an override through Special K (Windows)
Strangle (Linux, OpenGL/Vulkan)
Also works for Wine
  1. Download or clone Strangle and compile it according to instructions
  2. Use strangle <number> path/to/game command to run a game at desired framerate.

Notes

  • You can also use VSYNC=<0/1 or higher> before using the strangle command to enable the VSync instead of setting up the desired framerate. Higher than 1 will cause the software to set up a lower FPS by multiplying it by 1/<number you set in VSync>. So when it's set to 2 for example on a 120 Hz monitor, the software will run at 60 FPS, setting it to 4 will run the program at 30 FPS etc.
  • Not confirmed, but according to the Readme of the software, setting it to -1 will use the Adaptive VSync.
  • Can be also used on Steam via Set Launch Options.... Keep in mind that it won't work when Steam Overlay is enabled, unless it's placed at the end of LD_PRELOAD.

AMD

Radeon Settings
  1. Access the AMD Radeon Settings by right-clicking the desktop wallpaper and selecting the option, or by other means.
  2. Click on the Gaming tab.
  3. Provided the game is not listed, click on Add in the top right corner, then Browse to locate and select the executable of the game.
  4. In the main application window, click on Wait for Vertical Refresh and configure as desired.

Nvidia

The Triple buffering option in Nvidia Control Panel and Nvidia Profile Inspector only applies to OpenGL. Enable Fast Sync to get triple buffering in DirectX-based applications.[1]
Fast Sync requires a frame rate at least 2x above the refresh rate of the monitor to prevent micro-stuttering.[citation needed]
Nvidia Control Panel (Windows)
  1. Open the Nvidia Control Panel.
  2. Navigate to Manage 3D settings.
  3. Switch to the Program Settings tab and select or add the relevant application.
  4. Configure the following settings as desired:
    • For no V-Sync in either DirectX or OpenGL applications, set Vertical sync to Off.
    • For double buffered V-Sync in both DirectX and OpenGL applications, set Vertical sync to On.
    • For triple buffered V-Sync in DirectX applications, set Vertical sync to Fast Sync.
    • For triple buffered V-Sync in OpenGL applications, set both Vertical sync and Triple buffering to On.
  5. Click on Apply to save the changes.
Nvidia Profile Inspector (Windows)
  1. Download and run Nvidia Profile Inspector.
  2. When the relevant application profile is selected, configure the following settings as desired:
    • For double buffered V-Sync in both DirectX and OpenGL, set Vertical sync to Force on.
    • For triple buffered V-Sync in DirectX applications, set Vertical sync to Fast Sync.
    • For triple buffered V-Sync in OpenGL games, set Vertical sync to Force on and Triple buffering to On.
  3. Click on Apply changes to save the changes.

Use windowed mode (Windows)

On Windows, when playing a game in windowed or borderless fullscreen windowed mode, Windows automatically applies VSync.[4][5]


References

  1. 1.0 1.1 1.2 AnandTech - Fast Sync & SLI Updates: Less Latency, Fewer GPUs - last accessed on 2018-09-01
    "It’s interesting to note that Fast Sync isn’t a wholly new idea, but rather a modern and more consistent take on an old idea: triple buffering. While in modern times triple buffering is just a 3-deep buffer that is run through as a sequential frame queue, in the days of yore some games and video cards handled triple buffering a bit differently. Rather than using the 3 buffers as a sequential queue, they would instead always overwrite the oldest buffer. This small change had a potentially significant impact on input lag, and if you’re familiar with old school triple buffering, then you know where this is going.

    With Fast Sync, NVIDIA has implemented old school triple buffering at the driver level, once again making it usable with modern cards. The purpose of implementing Fast Sync is to reduce input lag in modern games that can generate a frame rate higher than the refresh rate, with NVIDIA specifically targeting CS:GO and other graphically simple twitch games.
    "
  2. 2.0 2.1 AnandTech - AMD Releases Radeon Software Crimson ReLive Edition 17.7.2: ReLive Edition Refined for Gamers and Developers - Developing a Better V-Sync: AMD Enhanced Sync - last accessed on 2019-09-10
    "AMD did not clarify if Enhanced Sync was an implementation of triple buffering when asked, citing an upcoming whitepaper on the topic. But at a glance, Enhanced Sync appears similar to a combination of NVIDIA’s Fast Sync (introduced with Pascal) and Adaptive V-Sync (introduced with Kepler). Regarding the latter, Adaptive V-Sync operates by selectively disabling V-Sync, which appears to be exactly how Enhanced Sync operates when framerates are below the refresh rate. In which case if AMD's implementation does behave similarly to NVIDIA's, then as we've already found with Fast Sync, to make the most of the technology you will need a framerate 2x (or more) higher than the refresh rate. This is because the closer the frate rate is to the refresh rate, the fewer opportunities there will be to "jump ahead" by discarding frames."
  3. FPS Limiter Lag Analysis For G-Sync & V-Sync - YouTube - last accessed on 2018-09-15
    "But what if you don't have such a [G-Sync] monitor, and the only way you can get rid of tearing is by using V-Sync, which does add quite a bit of extra delay, especially at 60Hz? Some people claim that by simply limiting your framerate to 1 or 2 frames less than the active display refresh rate, you can eliminate the extra delay caused by double-buffer V-sync.
    [...] This did, in fact, decrease the delay that you get with V-sync, even though it does not get as low as when you have V-Sync disabled. So, with this method, you get less delay when using V-Sync, while tearing is still avoided. But sadly, there is a drawback in the form of a periodic stutter, caused by the game's framerate being lower than the display refresh rate. How noticeable this effect is depends on your display refresh rate, your PC's ability to maintain this exact framerate, and the pace of the game.
    "
  4. ref 1
  5. ref 2