Multiview webxr (and optimization in general)

    // enable xr
    const xr = await scene.createDefaultXRExperienceAsync({
      floorMeshes: [ground],
      //multiView: true
      useMultiview:true
    });

^ I’m doing the above, but it doesn’t speed up my sketch at all
I’m kind of stumped as to how to optimize my vr scene, bc I believe one of the main ways of optimizing a non VR scene is changing the FOV; is that the same for VR?
Need some help with this…

also can you run the optimizer “in” vr?

I guess I’m looking for “vr optimization for dummies” <-- a starting point.

also the optimizer works great when I’m not in VR
I don’t know if I have to re-run it somehow once I enter VR?

I believe I have solved my problem.

Here’s what the problem was: I loaded in an OBJ with a bazillion polygons without realizing it. So, that was #1. #2. I think the picker was trying to pick out these bazillion polygons on the 100 different multiples of the mesh that I loaded, and the computer was just not having it.

A bazillion is a bit too much. I think we officially support up to gazillion polygons, but don’t quote me on that :slight_smile:

Happy you found a solution. Just wanted to add that webxr does not officially support multiview as of now, so adding multiview won’t do any good (or bad) to your scene.

2 Likes

I think I have to futz with the picker next, and make sure it’s intersecting with the ground and not the meshes. I think that would speed things up some more. Or, perhaps, only intersect with meshes in special cases.

So, I did that, and it works really well on the quest.

You can fly with the boids hundreds of feet in the air or fly in and out of the trees in the forest.

BAM

1 Like

@RaananW, greetings Ranaan, Gabe here from Frame. In the above example, I see useMultiview = true in the createDefaultXrExperienceAsync method, but I don’t see that as an available property in the API. I only see it for the VR experience helper. Is it possible to use multiview in the create xrexperience helper as shown in the top post here?

1 Like

Hi @gabrieljbaker, great to see you here!

WebXR does not support the OVR_multiview2 extension (the last time I checked). At least not in a way that is performant. I have to say that the last time I checked was a few months ago, so this might have changed!

I will be happy to check and get back to you.

1 Like

Hi @RaananW , we just had a nice talk with the Oculus Browser team and they suggested that multi-view over WebXR on Oculus Browser was in good shape. I also see this post: Multiview on WebXR

Any possibilities for multiview with webxr on Babylon?

1 Like

Sure! I can look into that.

Multiview would be great. It will require a bit of an architectural change on our side, but it is managable, I am sure :slight_smile:

2 Likes

@gabrieljbaker , is this multiview on Oculus browser also with anti-aliasing? Not that coding for support should not be started until that is resolved, unless it would change the approach.

I am a little confused by the issue listed “as being worked” on to play nice anti-aliasing in the link posted,

It has things merged, but also is still open. No activity has occurred on it for nearly 2 years. I turned anti-aliasing off for my scenes, and things are very jagged, you would really need to bring up frame rate if that was required to use it. Not a standard “optimization” in that case.

Hi @JCPalmer , Oculus Browser has their own multiview extension that seems to cover all the bases:

https://developer.oculus.com/documentation/oculus-browser/browser-multiview/#using-multiview-in-webgl-20

2 Likes

Looking at this, I notice that this is for VR, not XR. This is driven home when I ran the example on a Quest2, and it said ‘This browser does not support WebVR’ in addition to the tons of cubes also saying ‘WebVR’.

https://artyom17.github.io/webvr.info/mv/vr-presentation-new3.html

The fact that it mentions the anti-aliasing issue might mean it can be applied, although it handles it with an oculus specific extension OCULUS_multiview.

Yes, I’m not sure what that demo is. Looks like old stuff on the previous webvr api.

The Oculus Browser team suggested that implementing multiview is probably one of the most significant performance optimizations we could make, because they have it supported on the browser side! It does seem like their extension/support might tick all the boxes.

2 Likes

If you want to follow development (which has not yet started), please follow this github issue - [XR] Enable MultiView mode · Issue #10767 · BabylonJS/Babylon.js (github.com)

2 Likes