How does Unreal Engine handle vertical sync?

How does Unreal Engine handle vertical sync?

What is Vertical Sync?

Vertical sync refers to the synchronization of the vertical refresh rate of the monitor with the frame rate of the game. The vertical refresh rate of a monitor is determined by the number of times the screen is refreshed per second, while the frame rate of the game is the number of frames per second that are displayed on the screen.

When the vertical refresh rate of the monitor is higher than the frame rate of the game, it can cause visual glitches such as tearing and ghosting. This can be particularly problematic in fast-paced games where split-second decisions can make a significant difference in the outcome of the game.

On the other hand, when the vertical refresh rate of the monitor is lower than the frame rate of the game, it can cause stuttering and lag. This can be particularly problematic in games that require fast reaction times and precise control.

How Unreal Engine Handles Vertical Sync

Unreal Engine provides several options for handling vertical sync, including:

  • Adaptive Vertical Sync (AVS)
  • VSync
  • Tear-free VSync
  • Frame Rate Independent Vertical Refresh (FRIVR)

Adaptive Vertical Sync (AVS) is a feature in Unreal Engine that automatically adjusts the vertical refresh rate of the monitor to match the frame rate of the game. This can help eliminate visual glitches and improve overall game performance.

VSync is a traditional method for synchronizing the vertical refresh rate of the monitor with the frame rate of the game. It works by locking the vertical refresh rate of the monitor to the frame rate of the game, which can help reduce tearing and ghosting. However, it can also cause stuttering and lag in games that require fast reaction times and precise control.

Tear-free VSync is a variation of VSync that uses a technique called interpolation to smooth out the transition between frames. This can help eliminate tearing and improve overall game performance without causing stuttering and lag.

Frame Rate Independent Vertical Refresh (FRIVR) is a feature in Unreal Engine that allows developers to set an independent vertical refresh rate for their games. This can be useful in situations where the vertical refresh rate of the monitor needs to be higher than the frame rate of the game, such as when displaying high-resolution graphics or when using advanced post-processing effects.

Best Practices for Handling Vertical Sync in Unreal Engine

When working with vertical sync in Unreal Engine, it is important to keep the following best practices in mind:

  • Use adaptive vertical sync (AVS) whenever possible
  • Use tear-free VSync when displaying high-resolution graphics or using advanced post-processing effects
  • Avoid using VSync when fast reaction times and precise control are required
  • Test your game on a variety of monitors and configurations to ensure that it works well with different vertical refresh rates
  • Optimize your game for smooth and seamless gameplay by minimizing load times, reducing draw calls, and optimizing your code for multithreading

Common Mistakes to Avoid When Working with Vertical Sync

When working with vertical sync in Unreal Engine, it is important to avoid the following common mistakes:

  • Using VSync when fast reaction times and precise control are required
  • Not testing your game on a variety of monitors and configurations
  • Failing to optimize your game for smooth and seamless gameplay
  • Overusing advanced post-processing effects or high-resolution graphics, which can cause stuttering and lag
  • Not adjusting the vertical refresh rate of the monitor to match the frame rate of the game

Conclusion

Vertical sync is an important factor that can affect the performance and overall enjoyment of games in Unreal Engine. By understanding how Unreal Engine handles vertical sync, as well as best practices for handling it, developers can create immersive and enjoyable gaming experiences for their users. Remember to test your game on a variety of monitors and configurations, optimize your game for smooth and seamless gameplay, and avoid common mistakes when working with vertical sync to ensure that your games run smoothly and without visual glitches or stuttering.

By