When I set target framerate to 60 I got only 45 fps on my 90hz screen

Hi guys,
I have an Oppo a73 which has a 90hz display. In my game, when I set the vsync off and the target fps to 30 (in the menu for example), it works fine and the fps are locked to 30. But if I set the target fps to 60 (vsync off), then I only got 45 fps. Setting vsync ON and target fps to -1 works fine because I get about 80-90 fps…so I can go over 45, but with the target fps to 60 it doesn’t. It’s a common issue with 90hz display? Or I should check some quality settings?

If you have “Optimized Frame Pacing” enabled in PlayerSettings then it would be expected to get 45fps in this case.

2 Likes

Thank you! Now it works! Do you suggest to leave Optimized Frame Pacing enabled or not?

We recommend to use it, however we had a few issues with it. At the moment there are no known issues.

If the display only supports 90Hz and you want to render at a lower frame then 45fps is usually the best choice.

On other devices that support switching between 90Hz and 60Hz “Optimized Frame Pacing” should automatically switch the display to 60Hz in your case.

1 Like

Thank you for your answer. My device support switching between 60hz and 90hz, but when the “Optimized Frame Pacing” is on, I got 45 fps. Anyway, if there aren’t performance issues, I can leave it off i think

“Optimized Frame Pacing” mainly fixes the issue described here: Android Developers Blog: Android Game SDK.

1 Like

Thank you!

I have exactly the same problem. I set Application.targetFrameRate = 60 and only 45 in the game.

I turned Optimized Frame Pacing on and off, no effect.

I want to note that I moved from unity 2020, where I always had 60 fps, to 2021.2.11f1 and now 45 fps.

Android platform.

1 Like

Could you help me? My game in PC have 150+ fps. I have 60hz phone with vsync = 0, target frame rate = 60 and Optimized Frame Pacing = off, but i still got 29.9 fps on my phone. What i do wrong?

1 Like

Similar issue for me. This seems like a problem that has existed for many years. Would be nice if there was documentation that goes over the various refresh rate scenarios and what settings are needed for each.

[Edit] There is this ebook, but it doesn’t mention frame pacing. Is that option still needed? https://resources.unity.com/games/unity-e-book-optimize-your-mobile-game-performance

For anyone interested, adding more infos.

"To target a frame rate other than the maximum achievable frame rate or the platform default on mobile platforms, set Application.targetFrameRate to the screen’s refresh rate divided by an integer. If the target frame rate is not a divisor of the screen refresh rate, the resulting frame rate is always lower than Application.targetFrameRate.

Refresh rates of 60Hz, 90Hz, and 120Hz are common on today’s smartphones, though some can go up to 144Hz, 165Hz, or even 240Hz. Entry-level devices tend to ship with 60Hz pretty much across the board, while many midrange phones sit comfortably in the 60Hz to 90Hz range. High-end flagships often pack 120Hz panels and beyond.

For example, the Apple iPhone 14 Pro supports screen speeds of up to 120Hz. In the Android universe, phones such as the Asus ROG 6 Pro go as fast as 165Hz, while the Sharp Aquos Zero 2 features a best-in-class refresh rate of 240Hz. Because smartphone companies love to push the boundaries, we anticipate seeing higher refresh rates over time."

Maybe there is a more elegant way to calculate and write this but it does the job in my case.
1st param: The current mobile native refresh rate from Screen.resolution.
2nd param: Target FPS

private static int CalculateMinimumRefreshRate(float refreshRate, float minRefreshRate = 40f)
{
    if (refreshRate <= minRefreshRate)
        return (int)refreshRate;
  
    var divider = 0f;
    var lastValidDivider = 1f;
    const int limit = 1000;
    while (divider < limit)
    {
        divider += 1f;

        if (refreshRate % divider != 0f)
            continue;
      
        var value = refreshRate / divider;
        if (value >= minRefreshRate)
        {
            lastValidDivider = divider;
            continue;
        }
      
        var result = Mathf.RoundToInt(refreshRate / lastValidDivider);
        return result;
    }

    return (int)refreshRate;
}
2 Likes

Same here any solution for this problem?

In Unity 2020, although the fps can be set to 60 on a device with 90Hz refresh rate screen, but Time.deltaTime is unstable: https://discussions.unity.com/t/878925 .

For our game, I just set 90 fps for such devices to make Time.deltaTime stable. I also provide a option to set 45 fps.

1 Like