20 Fps drop on iOS when lowering brightness value using system Control Center
It happens always under OpenGL ES2, using Metal rendering works fine. It also happens using the post-processing stack (no matter the graphics API). I'm not sure what I'm talking about, but maybe is it related to the use of Shader Model 3? Everything looks equal in the profiler, just the cpu and gpu ms increases.
Thanks in advance.
Hardware iPhone X
Software iOS 11.2 Unity 2017.3.1 XCode 9.2
Answer by Mazapy · Mar 23, 2018 at 03:25 AM
Yes! I found a solution! It looks like the iPhone goes to some kind of low energy mode. So I thought of something that maybe could work to "wake-up" the view again.
In the Xcode project, go to the UnityAppController.mm file, find the applicationDidBecomeActive function and add this line:
_unityView.alpha = 0.99f;
This wake ups the view again when you comeback to the application!
No more 40fps at low brightness! BUT you have to add that line every time you built your application.
Best regards!
Thank you very much for sharing the solution. it worked for me. I added the line at the end of the applicationDidBecomeActive function, is that correct? Or should I add it inside the if-else statement?
As it doesn't seem like a common problem (couldn't really find anything), but I still can relate with my game. There should be a reason why it happened to our games but not other. Did anyone figure out the actual reason for this?
$$anonymous$$any thanks for this workaround!
It looks like this issue appeared for us after adding a native Game Center Access Point. $$anonymous$$aybe Unity should handle something with native UI windows. The other thing is that it reproduces on iPhone 12 and 12 $$anonymous$$ini, but everything is great on iPhone XR.
Answer by Sailendu · Mar 22, 2018 at 04:40 PM
I am also having this issue, my specs are also very same: iPhone X, iOS: 11.2.6, Unity: 2017.3.1p4, XCode: 9.2
The framerate drops suddenly after changing the device volume or using the Control Center. Then sometimes the fps comes back to normal after some seconds. But sometimes the fps stays very low till the end. Did you find any solution?