Question about the engine source code
Question about the engine source code
I've struggled with Vsync in Source engine games without seeing much delay in mouse movement. It doesn’t seem to work well across many titles, including TF2 and CS:GO. Is this an issue specific to the Source engine, and do you know of any solutions?
It appears Vsync isn't very helpful since it can disrupt many games.
Is there any solution? It seems to occur only in those two games you mention.
This issue stems from how V-Sync operates. It causes your GPU to pause before the screen updates, meaning any movement during that pause isn't visible. This occurs every time the monitor refreshes, especially when the GPU renders more frames than the display can handle at once. The lag becomes apparent in every game, but it's most noticeable in Source titles due to their fast-paced action.
The easiest fix is to disable V-Sync. This removes input lag but may cause screen tearing.
For competitive play, you can turn off V-Sync and set your console’s fps_max as high as possible. This minimizes lag while still allowing some tearing.
A middle ground is to switch off V-Sync and align your fps_max with your monitor’s refresh rate. This cuts both lag and tearing, though not to absolute zero.
Upgrading to a monitor with a higher refresh rate helps too. It reduces lag overall, but won’t eliminate it entirely.
The most advanced option is purchasing a high-refresh-rate monitor, keeping V-Sync off, and matching your fps_max to the monitor’s speed. This lowers lag from multiple sources, though input lag can't be fully eliminated.
Regarding display lag, only faster refresh rates or overclocking can help. Minimum lag is key for competitive gaming, but displays have limits.
Lowering fps_max mainly affects input lag; it doesn’t remove it completely. Tearing is acceptable if the trade-off improves responsiveness.
If you need less lag, consider using asynchronous techniques or hardware acceleration to keep your game running smoothly.