Hi everyone,
I'm programming a Google VR app for Android with Unity and I notice a performance drop when the app run on smartphone (Samsung Galaxy S6) after a few minute of usage.
Unity version is 5.3.4f1 and the version of Google VR SDK is 1.10.
In my scene there are only an inverse sphere (for 360 photos) and a panel (for info and photos) made with world space canvas, UI panel and buttons. A very simple scene. The only thing I do is download photos from web and apply them on sphere or on panel when I select a button in scene.
I used Profiler to control the app performance and there are no memory leak, because I destroy all the objects that I don't use anymore. But there is a process, called Graphic.PresentAndSync, that is very expensive for the CPU. In Internet I found these solutions:
So I have read all the Unity Optimisation Manuals and I reduced quality settings as suggested here: https://unity3d.com/learn/tutorials/topics/virtual-reality/optimisation-vr-unity.
Again, never is changed.
But when I tried to use Unity Camera (without stereo rendering) instead of Google VR Camera (with stereo rendering) the performance was fantastic.
Anyone can help me?
Thanks!
These are the phones supported: https://vr.google.com/daydream/phones/
Original poster is developing for GoogleVR not Daydream. Supported phones link irrelevant. I've also seen unexplainable performance drops when using Gvr
The technical preview (5.4.2f2-GVR13) has the GVR SDK natively integrated, so that would give you better performance. Just ensure that you switch to the Android platform before importing your project, the file Assets/Plugins/Android/AndroidManifest.xml doesn't exist, and you have checked "Virtual Reality Supported" with Cardboard enabled in Player Settings. Our native integration is also mainlining into Unity 5.6 and is currently in 5.6.0b5, and known issues with stability and in-editor emulation are currently being investigated.
For general development, reducing the number of draw calls and vertices would definitely help with performance, and I'd suggest using the Unity Profiler and Frame Debugger to get a better sense of where your performance resources are going.
The added cost of the stereo-rendering camera in the non-native integration is expected, and is alleviated in versions of Unity with the native integration.
Thank you all!
miraleung I followed your suggestions:
I tested the example cube scene in GoogleVRForUnity.unitypackage and I noticed the same results, a performance drop.
Hi there,
I've got the same issue running on Unity 5.4.2f2-GVR1.
I've tried lots of things from working on optimizing my scenes to even profiling using gapid! The performance drop happens after a couple of minutes and it appears as Gfs.WaitForPresent in Unity profiler. There is no clear solution and I'm just trying to migrate the project to a new combination of Unity/GVR which hopefully solves my issue.
Let me know if you were able to eventually fix the issue.
Just like the original poster I own a Galaxy S6 (Edge) and in the past I was experiencing these drops without any noticable pattern. My app is a 360 video player. The performance would drop from like 50-60 fps to something like 30-40 fps. My project was a "classic" Google Cardboard project (pre Google VR SDK era, from mid 2016). I noticed that these drops happen seemingly randomly and last a minute or so, and also when no sphere geometry is rendered at all, i.e. also in the menus (which, in my case, render in regular 2D portrait mode).
I have recently upgraded that exact code to the native Google VR integration + Unity 2017.1.1f1 and I am now experiencing a general slow down on "Cardboard" mode, compared to before. The performance looks more like 20-30 fps in average now on the same phone.
As I have just upgraded, I dont know yet if I might have missed a configuration option which needs to be changed for optimal performance.
Any recommendations or discoveries regarding low performance issues from other "upgraders"? Thanks!
In general, what you are describing sounds like thermal throttling, where the phone runs at max speed until it gets too hot, then slows down.
In terms of the difference between pre and post native, my guess is that you are now (unintentionally) rendering to a higher resolution than you were before. I suggest you play around with the VRSettings.renderScale.
Thanks @nathanmartz, will give that a try!
Same here. Original app was rock solid 60fps built on Unity 5.4.3 and GoogleVR SDK for Unity v0.8.0
Recently updated to Unity 2017.2 and GoogleVR SDK 1.120.0 and I'm getting the same erratic performance drops described here.
@nathanmartz Can you give us a clue as to what kinds of settings might help? Searching for VRSettings.renderScale on Unity just points to legacy documentation for 5.4
Your assumption that we're "rendering to a higher resolution than you were before" makes a lot of sense but I've no idea how to get back to what I had before. Any guidance would be very much appreciated.
EDIT: so I've since found this: https://gist.github.com/GOROman/baa82c8b8f43c43addefc1f19003bc2c
which links to updated docs and gives a usage example:
Unity 2012.1
https://docs.unity3d.com/2017.1/Documentation/ScriptReference/VR.VRSettings-renderScale.html
Unity 2012.2
https://docs.unity3d.com/2017.2/Documentation/ScriptReference/XR.XRSettings-eyeTextureResolutionScale.html
Would still love to know if there are any magic numbers to use for this setting and how the changes actually affect the resolution. Reading this article (https://forum.unity.com/threads/vrsettings-renderscale-vs-vrsettings-renderviewportscale.436216/) seems to imply that a RenderScale (or XRSettings-eyeTextureResolutionScale) of 0.5 is probably not going to halve the resolution.
Any GoogleVR experts know how to get back to the original GoogleVR SDK 0.8.0 performance?
@baroquedub The updated render scale is XRSettings.eyeTextureResolutionScale in 2017.2. Hope that helps!
thanks @dylandevs yep, just found it too. and in fairly typical Unity fashion, it's one of those pages along the lines of "here's a setting with a bit of an explanation of what it does but we're not going to tell you what to set it to" :)
I've just been doing builds using random values and 0.7 seems to get me back to what I had before without sacrificing to much quality so @nathanmartz was spot on I reckon. Thank you!
umm... seems as if I may have jumped the gun in terms of my celebrations.
New build went out to testers and they're all reporting very different results.
Some are finding dramatically worse performance from the lower RenderScale version. (15fps!)
Some are finding not much improvement (40-50fps)
And some are finding a solid 60fps for 30+mins of play (which is what I was getting before) but only some of the time - trying the same build again, on the same device and they're suddenly getting only 40fps.
I'm really stumped! Anyone got any ideas?
Most helpful comment
In general, what you are describing sounds like thermal throttling, where the phone runs at max speed until it gets too hot, then slows down.
In terms of the difference between pre and post native, my guess is that you are now (unintentionally) rendering to a higher resolution than you were before. I suggest you play around with the VRSettings.renderScale.