useMultiView option in createDefaultXRExperienceAsync with Typescript and Vite

Hi all, I can’t set useMultiview: true in the createDefaultXRExperienceAsync method using typescript with Vite, while it works in playground javascript:
Object literal may only specify known properties, and ‘useMultiview’ does not exist in type ‘WebXRDefaultExperienceOptions’.ts(2353)

What I’ve to do? Thanks

There are no useMultiview anywhere in the framework. It works in the JS playground cause there are no type checks in JS but true or false will do nothing.

This is the way to enable multiview using WebXR layers on supporting devices - WebXR Layers | Babylon.js Documentation (babylonjs.com)

The reaosn for the naming of the variable is that it will fall back to standard rendering if the underlying system does not support layers or multiview

Hi all, thank for the info.
@RaananW
But if I enable multiview, how can I double-check it is really on?

Hi all , I’ve created 2 playground for testing WEBXR with Oculus Quest 2 (with Oculus Browser):

1)Babylon.js Playground
preferMultiviewOnInit: true

2)https://playground.babylonjs.com/#F0XRDP#1
preferMultiviewOnInit: false

First of all: Very poor performance for a so “simple” scene.
My Quest 2 (with the OVR Metrics HUD) shows 40fps or less…
Something wrong in the code?

  1. I think the scene has antialas on, but the sky is gone!

  2. I think the scene has antialas off, but the sky is here!

What do you think about that?

I’ll look into that throughout the week. I don’t have a quest 2, so I am going to have to trust you on the results, though it is very odd because I used to test with a quest 1 and never got these low numbers.

Hi RaananW, eventually, how can I send you the data of my oculus quest HUD?
Thanks

The only thing you can send is a performance profile recording, but let me first investigate

Hi all, I make other tests…

@RaananW

I can activate cascadedShadow (normal shadow were very pixelated on so big ground I think) but the shadows “swimm” / “shimmer” even with stabilizeCascades set to on.

If I use the second method, instead of the first, to handle WEBXR (see source code notes) I can see nothing from the right eye.

When I move myself toward the scene, My Oculus Quest 2 OVR METRICS show very low value of FPS (from 25 to 45).
Here the playground:

And trying this other demo, when I grab and move the deer, I can’t go over 10 FPS…

I’ve tried also a demo about particle system (I simply add WEBXR functionality) :

On my quest 2, (latest firmware) in oculus browser, → very poor 11 FPS reached…

While we are waiting for RaananW investigations, someone else can gently try these playgrounds with an Oculus 2 or Meta 3 to check the FPS values?

Every Playground I’ve tested has given me very poor results.

Thanks

So, I did some debugging. Most of the issues here are perf issues you would have with any scene. The problem with XR is that you are rendering the entire scene twice. For example, take this -

testWEBXR | Babylon.js Playground (babylonjs.com)

Setting the performance mode before creating the meshes will probably increase the performance (does on my device). I am rendering this scene in 85-90 FPS.

Or

Create Fountain | Babylon.js Playground (babylonjs.com)

Which will render better.

Don’t forget that each scene starts with every feature the framework offers. Near interaction, pointer selection, teleportation enabled and more. And those are just the XR features. The scene itself should also be optimized to your specific use case (described wonderfully here - Babylon.js docs). I agree that you should expect a default scene to render as fast as possible. Here is the simplest scene, which, if doesn’t render in the (almost) highest FPS, we do have a problem:

Any unoptimized babylon scene is raw and needs to be prepared for production. There are many ways of doing it, which mostly depends on your use-case

Here is the simplest scene, which, if doesn’t render in the (almost) highest FPS, we do have a problem:

Houston, we have a problem.

Simply in the browser, this scene does render at 90 fps. Once you enter the VR experience, the framerate tanks. I’ve included screenshots.


I would like to know what hardware you are testing with, Raanan, because your numbers sound like you’re testing in Chrome with a Rift or Oculus Link, utilizing the PC’s video card rather than the snapdragon on the Quest.

i’m on quest 3, this is my main device at the moment.

I am not sure why you get 22 FPS. Here is a screenshot over time (note the drop right before taking a screenshot is me messing around with a few things before opening the camera app)

You can see the constant 88-90FPS over time.

I am not trying to convince anyone that they are wrong - I totally believe you. I can’t debug on your device, so it is hard for me to tell you what could have gone wrong there. But this high CPU and GPU usage on a scene with a sphere and environment feels impossible. We are not doing anything apart from rendering the scene twice. WebXR is simply renderloop * 2 per frame. no magic (once you remove the webxr features that are not available on the desktop). As it depends on the resolution of the rendered window, rendering in full FPS in the browser does not 100% mean that you will render in half FPS or more when in XR, as the fullscreen resolution is probably higher than the window rendering the scene in the browser. But still, if a mobile device can render this scene in the max FPS (and it does), no reason a quest won’t.

Anyone else cares to check the last scene i shared and share a screenshot?

1 Like

Hi all, hi RaananW.
I’ve tested the simplest WEBXR playground that you’ve created with my Meta Quest 2 (on oculus browser).

I cannot constantly go over 50fps and if I move my controllers (simply moving them in front of me)
the performances seem worse (large deep in FPS).

Here my screenshots:



I’ve noticed another thing (not 100% sure but it seems):
sometimes if I reboot the quest 2 and first of all I launch oculus browser, the performance are much better for a short period of time (even 80-90 FPS with this scene).
Then, perhaps after some period of time or after some movements, or after closing and reopening the scene, the perfomance are worse.

Anyone else can test this behaviour?
Thanks
Frank

1 Like

I’ve noticed that if you press the home button to see the dock and windows the performance goes up to the max you have configured (72fps in my case). I have the new multitasking feature enabled. When I close it (or pinch to focus in immersive experience in the browser) the performance drops drastically.

So, it looks like a issue with the OS or the Oculus Browser itself, not babylon.

@RaananW
Hi, any news about these issues?
Have you seen my tests and Julio3 observations?
Thanks