Seamless loading of asynchronous scenes and textures - Unity & GearVR

I have two serious problems with Unity (5.3.4p1) on GearVR with Samsung S6:

1) Asynchronous scene loading. Are there any changes that I can load a new scene in the background without seeing small freezes? The scene has ~ 60k triangles and uses a pair of 4k textures and ~ 10 other 2k textures. When this scene loads, there are a few short frosts. I know that I can avoid this by fading to black and then starting the download level. But it takes ~ 10 seconds, and the user can be seen seeing a black screen for such a long time with a VR headset.

2) Create textures from images loaded using the WWW class. I am using a 360 4k image displayed on a dome in a different scene. When I try to load a texture (4k, PNG or JPG) at runtime, it runs asynchronously. But Unity freezes for 2-3 seconds when I use:

Texture2D myTexture = www.texture; 

Is there any way to avoid this, besides using the downloaded bytes and decompressing the JPG or PNG using the non-Unity algorithm in the background, and then loading the created rgb values โ€‹โ€‹into a new texture? A good example of smooth texture loading can be seen in the Flickr VR application, but I doubt that they used Unity to create this application.

These two problems also occur on Oculus Rift, but are less noticeable due to the much higher PC performance.

As a rule, I want to achieve smooth loading in Gear VR using Unity. Is it possible?

+5
source share
1 answer

This question should be published as two separate questions, but still:

AD 1: Add a small preloader scene, visualize it for the user and load the main scene. Timewarp should still work, so changes in head orientation will be visible.

AD 2: Android devices cannot display jpeg or png. They must unpack them to very large uncompressed textures, load them into memory again, and only then render them. It takes a lot of RAM and time.

What you can do is have the textures in your own DXT or ETC format and load them as a texture yourself. I had the same problem and it accelerated the loading of my textures by almost 10 times. They also use less memory.

Please note that the download size will be larger, and depending on the texture format, you may need different files for different platforms.

+3
source

Source: https://habr.com/ru/post/1246915/


All Articles