# Multiview webxr (and optimization in general)

**URL:** <https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611>\
**Category:** Questions\
**Created:** [July 17, 2020, 10:56pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611 "2020-07-17T22:56:07Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 17, 2020, 10:56pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/1 "2020-07-17T22:56:07Z")

</div>

```
    // 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…

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 17, 2020, 11:04pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/2 "2020-07-17T23:04:23Z")

</div>

also can you run the optimizer “in” vr?

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 17, 2020, 11:15pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/3 "2020-07-17T23:15:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 17, 2020, 11:18pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/4 "2020-07-17T23:18:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 20, 2020, 2:09am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/5 "2020-07-20T02:09:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 20, 2020, 8:20am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/6 "2020-07-20T08:20:12Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 20, 2020, 4:30pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/7 "2020-07-20T16:30:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [July 20, 2020, 11:32pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/8 "2020-07-20T23:32:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gabrieljbaker](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gabrieljbaker/32/12670_2.png) [@gabrieljbaker](https://forum.babylonjs.com/u/gabrieljbaker)\
**Post date:** [December 8, 2020, 4:40pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/9 "2020-12-08T16:40:56Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 8, 2020, 9:00pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/10 "2020-12-08T21:00:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 9, 2020, 12:14pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/11 "2020-12-09T12:14:10Z")

</div>

Assigned @RaananW on December 9, 2020, 12:14pm UTC



---

<div class="post-metadata">

**Author:** ![gabrieljbaker](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gabrieljbaker/32/12670_2.png) [@gabrieljbaker](https://forum.babylonjs.com/u/gabrieljbaker)\
**Post date:** [March 26, 2021, 2:03am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/12 "2021-03-26T02:03:29Z")

</div>

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](https://blog.mozvr.com/multiview-on-webxr/)

Any possibilities for multiview with webxr on Babylon?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 26, 2021, 8:25am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/13 "2021-03-26T08:25:35Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [March 30, 2021, 1:16pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/14 "2021-03-30T13:16:58Z")

</div>

@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,

> <https://github.com/KhronosGroup/WebGL/issues/2912>
>
> We need to support multisampled multview rendering, but how to do so is tricky.
> Since we are using texture arrays for multiview,...

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.

---

<div class="post-metadata">

**Author:** ![gabrieljbaker](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gabrieljbaker/32/12670_2.png) [@gabrieljbaker](https://forum.babylonjs.com/u/gabrieljbaker)\
**Post date:** [March 30, 2021, 3:00pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/15 "2021-03-30T15:00:16Z")

</div>

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](https://developer.oculus.com/documentation/oculus-browser/browser-multiview/#using-multiview-in-webgl-20)

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [March 30, 2021, 3:21pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/16 "2021-03-30T15:21:11Z")

</div>

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](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`.

---

<div class="post-metadata">

**Author:** ![gabrieljbaker](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gabrieljbaker/32/12670_2.png) [@gabrieljbaker](https://forum.babylonjs.com/u/gabrieljbaker)\
**Post date:** [March 30, 2021, 3:35pm UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/17 "2021-03-30T15:35:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 15, 2021, 11:54am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/18 "2021-09-15T11:54:43Z")

</div>

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)](https://github.com/BabylonJS/Babylon.js/issues/10767)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 15, 2021, 11:54am UTC](https://forum.babylonjs.com/t/multiview-webxr-and-optimization-in-general/12611/19 "2021-09-15T11:54:44Z")

</div>

Unassigned @RaananW on September 15, 2021, 11:54am UTC


