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.

Question Changin VSync Count doesn't affect FPS on editor playmode

Discussion in 'Editor & General Support' started by tamana, Aug 29, 2022.

  1. tamana

    tamana

    Joined:
    Mar 14, 2017
    Posts:
    16
    Hey after upgrading from 2018 to 2020, we noticed that VSync Count on ProjectSetting -> Quality settings does not change the fps when entering playmode on editor.
    Previously on 2018 setting VSync Count to Every Second V Blank will lock fps to 30 on playmode. But, on 2020 the fps reach above 200 and changing VSync Count to other options wont change the output fps.

    Ah, yes I know in 2020 you can enable VSync with Game window by clicking Vsync (Game view only) on change resolution dropdown menu. But that doesn't solve our problem.

    Is there a way to lock the fps down to 30 with VSync Count ?
    I know I can set the fps to 30 with Application.targetFramerate. I just want to know why VSync Count doesn't work anymore after the upgrade and is there someway to make it work again like 2018 ?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,947
    Hello,
    The Editor never used vSync to begin with, it only emulates it via Application.targetFramerate. The changes to put a VSync option on the Game View and to put the previously implicit Editor throttling of 4ms into the Preferences under
    Preferences > General > Interaction Mode
    probably just made the previous behavior more explicit. It might've also clashed with the previous default behavior, I can't entirely recall the reasoning. But you should be able to get the refresh rate of the Editor locked down to 30 FPS again using these two options.

    (Also pre 2020, the Stats view was technically lying about the effective FPS by calculating out the Editorloop time)
     
  3. tamana

    tamana

    Joined:
    Mar 14, 2017
    Posts:
    16
    Martin Tilo.
    No, I still can't get 30 FPS even after changing Interaction Mode to say,, Custom Mode and set the frame throttling to 33ms. Is locking FPS on editor to 30 becoming impossible after the upgrade?
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,947
    That sounds more like a bug then. Could you please report that via Help > Report a Bug?
     
  5. tamana

    tamana

    Joined:
    Mar 14, 2017
    Posts:
    16
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,947
    If I understand this correctly, your monitor refresh rate is 360Hz, so
    Every Second V Blank
    would throttle to 230 FPS, not 30 FPS. Does that match what you are seeing? If so, I'd correct my previous assessment and say the old behavior was technically incorrect.

    Meanwhile, the
    Interaction Mode
    setting should take effect on the Editor redraws outside of Playmode only.

    So I guess with such a high refresh rate, Application.targetFramerate might be the only current workaround to get the logically correct working Editor to not run way too fast on such a monitor... (You could use Screen.currentResolution.refreshRate to detect such monitors and only use this workaround then).
     
  7. tamana

    tamana

    Joined:
    Mar 14, 2017
    Posts:
    16
    Can you please tell me the math behind on how you get 230 FPS from 360Hz with Every Second V Blank?
    And, no. If I run on empty scene, the fps will go to 144fps ( with 144Hz monitor ).
    Yes, Every Second V Blank is technically not working currently.
    I'm now waiting for the responses from the Unity's team.

    Yes, I know by using Application.targetFramerate I can limited the fps to 30.
    But our team was previously using Every Second V Blank from version 2018,
    and the frame limiter is not working anymore after we upgraded the project to version 2020.
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,947
    Nah, because my math brain messed up on me. I meant 180FPS. But if a 144Hz monitor doesn't go down to 72FPS with QualitySettings.vSyncCount=2 then, yeah, the frame limiter in the Editor (which isn't using vSync in the editor but in my understanding should at least Mimik it) is bugged. 30 would still be wrong though.

    In other words it never worked correctly to begin with...