1
votes

I've been having performance issues on my GearVR app (developed on Unity 5.4) so I decided to do a small experiment and set up the simplest possible scene to study performance:

  • One static plane
  • One static cube
  • Both with the same material: mobile unlit shader with 8X8 unicolor texture
  • One baked directional light
  • Default fastest quality settings
  • Default player settings save for VR enabled and multi-threaded rendering enabled

On my PC, when I look at the profiler I get the following profile:

PC profile profile

About what you'd expect: close to 4000 FPS.

However when I build my exact same scene and run it on my Galaxy S6 (with ETC2 GLES 3.0 texture compression), I get this profile:

enter image description here

It's now gone down to about 60FPS. WTF? When I look a bit more into the details I see that the vast majority of the CPU usage time is spent waiting for the GPU:

enter image description here

And then when I look at the GPU usage I see that it spends 99% of its time applying GUITexture.draw:

enter image description here

The problem is... there is no freaking GUI texture in my very simple scene! I don't understand any of this. Could someone explain to me what is happening and how to reduce the extreme difference in performance between PC and mobile?

1

1 Answers

2
votes

I don't know if you have found the answer (I hope you did), but I had the same issue not long ago and others may face the same problem.

1) GUITexture.Draw

The GUITexture.Draw is due the "development build" mode. It adds a dev watermark texture after rendering the whole scene. We can see it in Unity's frame debug. Unity frame debug

The shader properties says it uses a texture named "UnityWatermark-dev" as _MainTex. You can confirm using a graphics debugger, I used the Mali Graphics Debugger.

Here what the texture would be like: UnityWatermark-dev

I don't know why it creates such overhead in VR mode, but it's quite inexpensive when you disable the VR.

2) Profiling

Don't use your PC when profiling, unless your planning to launch a rift or vive version. There's great difference in process power between your Galaxy S6 and your PC (or even between PCs if your GPU and processors are different).

Always use your target device when profile. It's the only way to have the proper insight of what is happening in your project. If you want to launch a Rift/Vive project profile it your PC, if you want a GearVR version profile it in your mobile devices too.