- Home /
Getting to 60fps on iOS
Hi all,
I'm building a pretty simple app with a couple of GameObjects and a few simple scripts. When I built to iOS, I expected the frame-rate to be 60fps solid as I've only spent a couple hours on the project and only have a couple of objects and scripts. But I got 30fps. I saw the trick about setting the Application's targetFrameRate, so I did that. Still 30.
So I did a test. I made a blank scene with just a camera and my FPS counter UI, and the targetFrameRate script. Still 30, with no GameObjects besides the camera and UI (with one text element) and no script besides setting the targetFrameRate.
So what's going on? How can I achieve 60? I'm using Unity 5.3.5, btw. Thanks for your time.
Well, iOS always has vsync enabled and uses a strict one. As soon as your frame time is greater than 16.6666 ms you will drop to 30 fps (the next smaller stable vsync rate --> 33.333 ms).
So depending on your actual hardware you mght have too many drawcalls or you use too heavy shaders (Unity's standard shader for example).
Some hardware also have other restrictions which might limit the framerate to 30 fps. How do you count your FPS? Do you use a skybox or do you just clear the background?
Answer by tanoshimi · Sep 21, 2016 at 05:26 PM
From your description, it sounds like you're using the default procedural skybox on your camera, which is a per-pixel shader. If you're running a mid-range iPhone, just filling every pixel on the screen with that shader could be enough to exceed 16.6ms frametime, forcing you down to 30FPS.
Try setting the camera clear flag to a solid colour instead - does that work? If not, are you sure your target frame rate script is being executed?
I should mention two things that I neglected to mention: I'm testing on an iPhone 6S Plus on iOS 10, and I installed a simple skybox texture using the "$$anonymous$$obile/Skybox" shader since I had already heard about the skybox issue.
I'll re-build the project with no skybox and a test to make sure the script fired, and get back. Thanks for the response.
Your answer
Follow this Question
Related Questions
Is iOS hardware always locked at 60hz? 1 Answer
iOS VSync always active? 1 Answer
Create 'Tippex' for a drawn line. 1 Answer