Search Unity

Why does FPS double when VSync is enabled? (solved)

Discussion in 'General Graphics' started by malkere, Apr 9, 2019.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I had a number of players test this for me after seeing it on my own computer. A user with a better graphics card had the expected results of ~75 fps with VSync off, and ~60 fps with VSync on. Myself and others with perhaps less capable graphics cards go from ~30 fps with VSync off to ~60 fps with VSync on. Using the task manager performance tab just for reference I gathered these stats on my machine:
    VSync off: CPU: 20-24%, GPU: 40%, ~30 fps
    VSync on: CPU: 38-39%, GPU: 90%, ~60 fps

    So... I don't get it?.... of course 60 fps is better than 30... why does my game run 30 fps when I turn VSync off? This is 3D, 2018.3.9, tested on multiple machines.

    My first thought was my FPS counter must be bugged, so I turned on Steam's built-in, and it gave the same results.
     
  2. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I've since tried forcing targetFrameRate to 300 and still no change.
     
  3. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I bound a key to cycle between vsync 0, 1, and 2. 0 and 2 give almost the exact same results 26-30 fps, 1 gives 58-60.
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    the live version of my game is a build from 2018.2.2 and the vsync settings work properly. I run GPU 100% at 70 fps with VSync off, unlike 2018.3.9. Building a project from scratch to reproduce.

    project from scratch worked =o=
     
    Last edited: Apr 9, 2019
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    It was Mirror imposing a "server tick rate". Interesting that VSync ON will override targetFrameRate (and confusing)
     
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    malkere likes this.
  7. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    The given example of higher to lower is intuitive, I just wasn't able to guess that it could produce lower to higher. In the end it was my fault for clicking "find all references" on a call to targetFrameRate instead of "find all", when nothing showed up I thought my solution was clean and I'd already looked into the obvious =[ several hours later there it was in plain sight.