Preloader for VR scene

Can somebody please clarify a little to me ?

I would like to make small immersive VR experiences for children that are webbased.
These experiences will be for primary school kids and involve learning math

But… I would need to preload the needed assets (glb files and other possible assets) BEFORE the user can enter immersive VR mode on the browser.

I know from the demo’s that on a VR app there is a icon in the right bottom to toggle immersive mode.

Can I start the app with a very simple preloader that shows a preloader bar of even just a percentage and then get some kind of event once everything is preloaded?

Any demo’s anywhere?

Kind regards,
Bart

Hello :slight_smile:

Starting from the demo from the doc, this line :

const xr = await scene.createDefaultXRExperienceAsync();

Is the line which enables XR (and enables the toggle immersive mode in the corner of the page)
You would only need to run it after assets are loaded


Here is a Playground for you :

  • Waiting a bit before launching asset load
  • Loading asset (logging in 3D the progress)
  • Assets loaded, ready to enter XR
  • Delete the 3D log on XR enter

Just tested on my Quest3 :heavy_check_mark: :slight_smile:

++
Tricotou

1 Like

wow nice. That piece of code does indeed demonstrate a lot already. Thank you.

1 Like