Search Unity

Mobile - Is there any difference setting VSync of FrameRate?

Discussion in 'Editor & General Support' started by resetme, Nov 19, 2019.

  1. resetme

    resetme

    Joined:
    Jun 27, 2012
    Posts:
    204
    Hi there,

    When we deploy for mobile devices, Android or iOS, is there any difference in:

    Target device refresh rate = 60;

    Application.vsynccount = 1 (FPS cap at 60 fps)
    or
    Application.vsynccount = 0;
    TargetFrameRate = 60 (FPS cap at 60 fps)

    Inside unity are they doing the same? is a huge difference?
    Also on mobile even if u set VSync = 0 the device will keep doing own Vsync.
    Can I have more detail explanation on this topic?

    We have many projects here and some projects said that VSync = 2 (30 fps on mostly mobile) is a lot more stable than Vsync = 0, TargetFPS = 30.

    Why would be that?

    Thank you.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    TargetFrameRate is implemented using a software sleep(). Vsync is implemented by waiting for the GPU. VSync is superior if you can use it.
     
  3. resetme

    resetme

    Joined:
    Jun 27, 2012
    Posts:
    204
    Thank you so much, two more question, I promise!

    1- sleep implementation for frame pass is for Android only? iOS and Android? both will have similar results?
    2- if my device is 90 refresh rate, setting sync at 2 give me 45 fps, but actually I want 30 fps. there is no other way than using targetFrameRate = 30?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    1. It's the same for all platforms;
    2. How about you set vsync to 3 in that case?
     
  5. resetme

    resetme

    Joined:
    Jun 27, 2012
    Posts:
    204
    Thank you!
     
  6. resetme

    resetme

    Joined:
    Jun 27, 2012
    Posts:
    204
    ok, we are going for the VSync approach, the only issue we have is with phones that have 100 refresh rate.