I am looking for some clarification and direction regarding some performance issues. My game is generally smooth, but often suffers from a stutter. I just enabled the profiler and got it setup so I can profile directly from the Note 4 while the game is playing. I immediately recognized that both Gfx.WaitForPresent and Overhead are causing spikes and killing my FPS.
Settings & version:
Unity v. 4.6.2
Oculus Mobile SDK 0.4.3
Mac OSX Mavericks
Fixed Timestep/Max allowed time = 0.166666
Quality settings set to Fastest (no shadows, Anti-Aliasing disabled, texture quality Eighth, Pixel Light Count = 0)
Other Settings (I have static & dynamic batching enabled)
I use Ambient Light (not a game component light source)
I believe I have followed all the settings rules outlined in the SDK documentation.
NOTE: All profiler data below if from the phone hardware (not my desktop).
Issue/Question #1: Gfx.WaitfForPresent
In my current build, this item in the profiler uses anywhere from 40%-90% of the CPU usage, with many occurrences pushing the FPS well below 60 (all by itself)
This example is from a static scenehttps://www.dropbox.com/s/l23wtkxhbcbzkii/GFXandRender.png?dl=0
For a scene that falls into all the guidelines for Tris, Verts, Draw Calls (and quality setting turned all the way down) why is Gfx.WaitfForPresent eating up so many resources? As I understand Gfx.WaitfForPresent, it occurs when the GPU isn't rendering the frame fast enough for the CPU (causing the CPU to wait). Is this correct? What am I overlooking here?
I also tested an "empty" scene and Gfx.WaitfForPresent was also very high. I was very surprised that an empty scene couldn't even keep a consistent FPS over 60.
Issue/Question #2: Overhead
About once every 15-30 seconds the Overhead in the profiler spikes up to around 90% and it causes a huge stutter in the game. As I understand, Overhead can be caused by errors/warnings that appear in the console. When I run the game in Unity, I get no warning/errors in the console. However, when I run the game on the phone, I get about 14 warnings. All of them pertain to some value in various OVR scripts that are assigned by never used. Could all these warnings cause this spike in Overhead?https://www.dropbox.com/s/y8npt5ohv06318n/overhead.png?dl=0
As a side note, when I play the game in Unity, the game as viewed in the "game" screen moves in slow motion. Meaning the player/game objects move very slowly compared to how fast the game actually is (when played on the phone). Has anyone else encountered this issue? Could this be a symptom of a Unity/SDK integration error?
Any input/advice would be greatly appreciated.