![]() Note that mobile platforms ignore the QualitySettings.vSyncCount setting. If the target frame rate is not a divisor of the screen refresh rate, the resulting frame rate is always lower than Application.targetFrameRate. 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. To target the default frame rate, set Application.targetFrameRate to -1. Usually, the default frame rate on mobile platforms is 30 fps. To conserve battery power, the default frame rate on mobile platforms is lower than the maximum achievable frame rate. Screen.currentResolution contains the screen's refresh rate. To target the maximum achievable frame rate, set Application.targetFrameRate to the screen's refresh rate. For example, a device with a refresh rate of 60 Hertz has a maximum achievable frame rate of 60 frames per second. To use the platform's default frame rate, set Application.targetFrameRate to -1.Ī mobile device's maximum achievable frame rate is the refresh rate of the screen. On standalone platforms, the default frame rate is the maximum achievable frame rate. 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. When you use vSyncCount, Unity calculates the target frame rate by dividing the platform's default target frame rate by the value of vSyncCount. On all other platforms, Unity ignores the value of targetFrameRate if you set vSyncCount. Instead, the VR SDK controls the frame rate. VR platforms ignore both QualitySettings.vSyncCount and Application.targetFrameRate. Use Application.targetFrameRate to control the frame rate on mobile platforms. Mobile platforms ignore QualitySettings.vSyncCount. targetFrameRate controls the frame rate by specifying the number of frames your game tries to render per second, whereas vSyncCount specifies the number of screen refreshes to allow between frames. Note that platform and device capabilities affect the frame rate at runtime, so your game might not achieve the target frame rate.īoth Application.targetFrameRate and QualitySettings.vSyncCount let you control your game's frame rate for smoother performance. You can also reduce your game's frame rate to conserve battery life on mobile devices and avoid overheating. For example, you might need to reduce your game's frame rate to make sure your game displays smoothly and consistently. Use targetFrameRate to control the frame rate of your game. Unity tries to render your game at that frame rate. ![]() Otherwise, targetFrameRate is a positive integer representing frames per second (fps). In the default case, Unity uses the platform's default target frame rate. The default value of Application.targetFrameRate is -1.
0 Comments
Leave a Reply. |