- Home /
Graphics.PresentAndSync consuming a lot of time
Profiling our game on mobile, Graphics.PresentAndSync -> Device.Present consumes 50%-75% of the cycle time and performance is quite poor (between 15 and 30 fps, we're striving to get 60), both tested on Android and iOS.
VSync is turned off in the quality settings of the project and the targetframerate is set to 60.
There are some elaborate posteffects on the camera (a fullscreen blur and sunshafts, both effects were optimized for mobile), but turning them off doesn't change almost anything about the consumption of Device.Present
What exactly is happening in Graphics.PresentAndSync -> Device.Present and what reasons other than Vsync could cause the long time spent in these routines?
Answer by wildex999 · Mar 16, 2014 at 08:15 PM
This related post might be of interest: http://answers.unity3d.com/questions/627156/sigificant-devicepresent-with-vsync-turned-off.html
Other than that, maybe you are simply doing something in rendering that takes a lot of time. From what I have heard, Android and iOS doesn't have the best bandwidth when it comes to rendering, so full screen post effects can be pretty hard on them.
Try removing/reducing what is rendered until you figure out what has the highest hit on the render time.
Thank you! I saw that post already, but not hooking up the profiler doesn't change something about the fps I experience. And as stated, removing the expensive post effects almost doesn't change anything about the fps, so I assume the problem is not overdraw. This is why I try to understand better what this method is exactly doing, so that I can figure out how to optimize it
Answer by acorrow · Sep 11, 2015 at 06:52 PM
I know this is old but...
http://forum.unity3d.com/threads/graphics-presentandsync-problem.318705/
This was an issue I was just having. I responded above, so I don't want to include the whole thing here (no need to duplicate), but the long and short of it was that I was using multiple outline components on a few images in my UGUI canvas (in the Level HUD). I used the multiple outlines to make a styled effect. As I understand it, this would create MANY (possibly exponential, i was using 4 outlines per icon and 4 icons...) rendering passes.
I'm not 100% sure on exactly why it would suck so hard on Android specifically, so maybe someone can elaborate. But my lesson learned here is to just draw the damn icon the way i want it outside of unity :P
Hope this helps someone!