Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Very bad performance with vsync tuned off.

Discussion in 'High Definition Render Pipeline' started by MishDotCom, Apr 16, 2022.

  1. MishDotCom

    MishDotCom

    Joined:
    Jan 17, 2021
    Posts:
    34
    Hello!
    I am developing a game with HDRP and the release date is right around the corner. There is a problem with the performance. It appears when profiling the build that the vsync kills the framerate. See the picture for the profiler data. Any help on how to mitigate the overhead is welcome!

    PC Specs:

    GPU : Nvidia RTX 3060
    CPU : Intel core i9-10900k
    RAM : 32 gb
     

    Attached Files:

  2. MylesLambert

    MylesLambert

    Joined:
    Dec 31, 2012
    Posts:
    61
    Your title says "Very bad performance with vsync tuned off." but the post says "that the vsync kills the framerate".
    Which is it?

    From your screenshot this is exactly what would be expected, vsync is syncing the frametime with your monitors refresh rate. This is achieved by delaying the frame the appropriate time.
     
  3. MishDotCom

    MishDotCom

    Joined:
    Jan 17, 2021
    Posts:
    34
    yeah but I have turned off the vsync in the quality settings with “QualitySettings.vSyncCount = 0;” and it still acts as if it is on. i also have Application.targetFramerate set in a script.
     
  4. iDerp69

    iDerp69

    Joined:
    Oct 27, 2018
    Posts:
    40
    "i also have Application.targetFramerate set in a script."

    Well there's your problem. Set that to -1; you shouldn't be using that unless you're on a menu or something (to prevent cooking people's CPUs/GPUs). https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

    I've been very happy with vsync in Unity, and would probably have it set on by default for players.