Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Adron's avatar
Adron
Explorer
10 years ago

Gear VR Loading screen freeze

Hi,

i am making a loading screen for my Gear VR project. I also made a custom loading/splash screen. It runs very good.

It contains two scenes: 1. the loading scene 2. the main scene

The only problem is that during the loading process the loading scene freezes in the end for a couple of seconds. (you can still move your head but the frame stays in one place) after that the main scene loads normally. The main scene contains a 4k 360° Video.

I am using the following code:

void Update () {
if (!mainLoaded) {
mainLoaded = true;
Application.backgroundLoadingPriority = ThreadPriority.Low;
StartCoroutine (LoadMain ());
}
}
IEnumerator LoadMain () {
AsyncOperation loadOperation = Application. LoadLevelAsync (1);
if (loadOperation.isDone) {
yield return loadOperation;
}
}

Is there a way to get rid of this short freeze?

4 Replies

Replies have been turned off for this discussion
  • Unfortunately, a large single asset is likely to cause a stall no matter how low the loading thread priority is. We are working on a built-in splash screen that would display a single textured quad using asynchronous TimeWarp and shouldn't be affected by stalls in Unity. But it won't be available for at least a couple of weeks. In the meantime, you could try breaking up your video or streaming it from disk. What codec are you using for the video?
  • Thank you for the answer.
    The codec is H.264 in mp4 format and the video is 100mb big.
    But i am using the Easy Movie Texture Plugin from the Unity store and the video is permanently on the device and is being streamed by the plugin.
    The problem is, if i turn off the plugin so there is basically just a sphere with a texture on it, the loading screen still freezes for a couple of seconds.
  • There must be something else large in your scene. Does the freeze occur with an empty scene? You should be able to "bisect" to the asset(s) that are causing the slowdown.
  • It might be the freeze is while activating the main scene - it sounds like something big being loaded on scene startup. If you debug out after the isDone if statement, maybe you can spot if that occurs before the freeze - which points to something going on when your new level starts.

    You can detect that more easily if you use loadOperation.allowSceneActivation = false; first. Then debug out, and pause a bit before you activate the scene by setting that to true.

    HTH

    Peter