question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unity’s built-in LoadScene doesn’t work well for VR. Some non-VR games use it rather than bothering with the async or additive version of LoadScene because it’s a simple call. Unfortunately, in VR the sync nature means that rendering is blocked, FPS on the headset plummets to 0, and while the next scene is loading the user is kicked back to the dashboard. So implementing scene loading correctly is an important issue in VR.

The SteamVR Unity Plugin contains a SteamVR_LoadLevel component and API that offers an alternative for use in SteamVR and appears to do an number of things:

  • It creates an progress bar and loading screen display as OpenVR overlays and also renders them to the companion window shown on the desktop
  • Allows you to specify a skybox/color to theme the SteamVR dashboard and whether to display the grid
  • Automatically fades out to the dashboard and stops rendering
  • Handles sync/async/additive loading itself
  • Does GC, warms up shaders, fades back out of the dashboard
  • And does all this in a coroutine you can easily call without needing to use Unity’s poor LoadSceneAsync api directly.

VRTK could use its own VRTK_LoadScene component to simplify scene loading in VR.

There are 2 ways that a VRTK_LoadScene could work.

  1. It could be a platform wrapper script:
  • If the current VR platform/SDK has its own LoadScene implementation such as SteamVR_LoadLevel implementing a loading screen, it could be used
  • If the current platform doesn’t it could simply fall back to traditional (async) scene loading
  1. If possible, it could be a high-level async loading implementation:
  • We could implement base components for handling a floating progress bar / loading screen
  • All the LoadSceneAsync handling could be abstracted to a VRTK_LoadScene.Begin (function) or VRTK_LoadScene.Load (coroutine).
  • Perhaps something like a fade-to-black blink could be used for the momentary transition between scenes

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:17
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bddckrcommented, Jan 8, 2019

Any implementation should definitely just be about abstracting overlays. The target shouldn’t be a specific use case.

With v4 work going on it will be a while until I can have a look at this but it’s still on my radar.

1reaction
bddckrcommented, Aug 22, 2017

Guys. If there is any you’ll see it because this issue is updated. You could also do it yourself, PRs welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble loading new scene with VRTK and Unity ...
I'm trying to load a new scene in Unity (5.6.1) with VRTK but having troubles. I've tried SceneManager.loadscene (both single and additive ...
Read more >
VRTK UI doesn't work after load scene
Hi guys, I'm having a problem where every time I load to new scene, vrtk's ui stop working. Ui pointer just goes straight...
Read more >
Unity Scripting with VRTK beta v4 - YouTube
This video is meant as a companion to the VRTK tutorial on Unity Learn: ... LoadScene ("sceneName"); } public void ToggleActive(GameObject g) ...
Read more >
Getting Started
Download or clone vrtk. Open the folder in Unity to load the project. Have a look at the included example scenes. The example...
Read more >
How to change Scenes in VR games : r/Unity3D
Problem is, I'm not using the VRTK plugin, I'm using the SteamVR plugin only. I don't think it's worth importing the VRTK just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found