Search Issue Tracker
By Design
By Design in 2022.2.X
Votes
0
Found in
2021.2.13f1
2022.2.0a5
Issue ID
UUM-3566
Regression
No
[M1 Max] Player ignores Application.targetFrameRate
Reproduction steps:
1. Open the user's attached project
2. Build the project
3. Open the player and observe the on-screen FPS counter
Expected result: 60 FPS
Actual result: 120 FPS
Reproducible with: 2021.2.13f1, 2022.2.0a5
Could not test with:
2022.1.0b9 (because of case 1399524)
2019.4.36f1, 2020.3.30f1 (compiler errors after downgrading)
Notes:
Does not reproduce with M1 and Intel Macs
Does not reproduce in Editor
Reproduces with both Mono and IL2CPP
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
According to the documentation of Application.targetFrameRate (https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html):
"On all other platforms, Unity ignores the value of targetFrameRate if you set vSyncCount. When you use vSyncCount, Unity calculates the target frame rate by dividing the platform's default target frame rate by the value of vSyncCount. For example, if the platform's default render rate is 60 fps and vSyncCount is 2, Unity tries to render the game at 30 frames per second."
In the project, QualitySettings.vSyncCount is set to 1 and so the target frame is ignored, as expected.
To make the application run at approximately 60 frames per second when vSync is enabled, then QualitySettings.vSyncCount needs to be set to an appropriate value. For example, on a 120 HZ screen, setting QualitySettings.vSyncCount to 2 will make the application run at 60 frames per second. In the same manner, on a 60 HZ screen, setting QualitySettings.vSyncCount to 1 will make the application at 60 frames per second. The current screen refresh ratio can be retrieved from Screen.currentResolution. Then it can be used to calculate an appropriate value for QualitySettings.vSyncCount.
Resolution Note (2022.2.X):
According to the documentation of Application.targetFrameRate (https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html):
"On all other platforms, Unity ignores the value of targetFrameRate if you set vSyncCount. When you use vSyncCount, Unity calculates the target frame rate by dividing the platform's default target frame rate by the value of vSyncCount. For example, if the platform's default render rate is 60 fps and vSyncCount is 2, Unity tries to render the game at 30 frames per second."
In the project, QualitySettings.vSyncCount is set to 1 and so the target frame is ignored, as expected.
To make the application run at approximately 60 frames per second when vSync is enabled, then QualitySettings.vSyncCount needs to be set to an appropriate value. For example, on a 120 HZ screen, setting QualitySettings.vSyncCount to 2 will make the application run at 60 frames per second. In the same manner, on a 60 HZ screen, setting QualitySettings.vSyncCount to 1 will make the application at 60 frames per second. The current screen refresh ratio can be retrieved from Screen.currentResolution. Then it can be used to calculate an appropriate value for QualitySettings.vSyncCount.