# useMultiView option in createDefaultXRExperienceAsync with Typescript and Vite

**URL:** <https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537>\
**Category:** Questions\
**Created:** [August 4, 2024, 1:39pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537 "2024-08-04T13:39:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 4, 2024, 1:39pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/1 "2024-08-04T13:39:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 5, 2024, 10:16am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/2 "2024-08-05T10:16:18Z")

</div>

Assigned @RaananW on August 5, 2024, 10:16am UTC



---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 5, 2024, 10:18am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/3 "2024-08-05T10:18:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 5, 2024, 10:19am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/4 "2024-08-05T10:19:31Z")

</div>

Unassigned @RaananW on August 5, 2024, 10:19am UTC



---

<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:** [August 5, 2024, 1:49pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/5 "2024-08-05T13:49:11Z")

</div>

This is the way to enable multiview using WebXR layers on supporting devices - [WebXR Layers | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/webXR/WebXRSelectedFeatures/WebXRLayers#enabling-multiview)

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

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 10, 2024, 8:33am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/6 "2024-08-10T08:33:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 11, 2024, 12:52pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/7 "2024-08-11T12:52:22Z")

</div>

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

1)[Babylon.js Playground](https://playground.babylonjs.com/#F0XRDP)  
preferMultiviewOnInit: true

2)[https://playground.babylonjs.com/#F0XRDP#1](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?

---

<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:** [August 12, 2024, 10:06am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/8 "2024-08-12T10:06:21Z")

</div>

Assigned @RaananW on August 12, 2024, 10:06am UTC



---

<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:** [August 12, 2024, 10:06am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/9 "2024-08-12T10:06:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 13, 2024, 7:20am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/10 "2024-08-13T07:20:47Z")

</div>

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

---

<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:** [August 13, 2024, 12:06pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/11 "2024-08-13T12:06:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 19, 2024, 10:35am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/12 "2024-08-19T10:35:07Z")

</div>

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:

> **[Babylon.js Playground](https://playground.babylonjs.com/#DBA1X3%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

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

> **[Babylon.js Playground](https://playground.babylonjs.com/#AZML8U%23230)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [August 20, 2024, 7:25am UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/13 "2024-08-20T07:25:54Z")

</div>

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

> **[Babylon.js Playground](https://playground.babylonjs.com/#TC31NV%232239)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

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

---

<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:** [August 29, 2024, 5:43pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/14 "2024-08-29T17:43:50Z")

</div>

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)](https://playground.babylonjs.com/#DBA1X3#5)

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)](https://playground.babylonjs.com/#TC31NV#2245)

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](https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene)). 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:

> **[Babylon.js Playground](https://playground.babylonjs.com/#F41V6N%231686)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

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

---

<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:** [August 30, 2024, 6:35pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/15 "2024-08-30T18:35:43Z")

</div>

Unassigned @RaananW on August 30, 2024, 6:35pm UTC



---

<div class="post-metadata">

**Author:** ![Jattier](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jattier/32/30421_2.png) [@Jattier](https://forum.babylonjs.com/u/Jattier)\
**Post date:** [September 2, 2024, 5:26pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/16 "2024-09-02T17:26:48Z")

</div>

> 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.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/6/a69b58ce07af19e5868cc231b726b1c4d42d229b.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/b/ab4927f5214c3e22a0a660e0a3b21460af888b80.jpeg)

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.

---

<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 2, 2024, 6:49pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/17 "2024-09-02T18:49:06Z")

</div>

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)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/2/62e56d9d17801f85d7e153b46d8d0e618d57d926.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [September 7, 2024, 2:50pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/18 "2024-09-07T14:50:40Z")

</div>

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:

 ![controller_1](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/5/15083fdbcc4da31db7eb8000e6a6c87278bb384d.jpeg)  
 ![controller2](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/b/1b2683d0ae2b790c8de38b9278230d6c9949b5df.jpeg)  
 ![no_controller](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/e/8ecbe71be04d13f7713f6620855bd59334bf1e4c.jpeg)

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

---

<div class="post-metadata">

**Author:** ![julio3](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/julio3/32/36321_2.png) [@julio3](https://forum.babylonjs.com/u/julio3)\
**Post date:** [September 11, 2024, 3:19pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/19 "2024-09-11T15:19:55Z")

</div>

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.

[![](https://img.youtube.com/vi/aBxvVoqv4g0/maxresdefault.jpg "Babylon.js XR low performance when home menu is not visible.") ](https://www.youtube.com/watch?v=aBxvVoqv4g0)

---

<div class="post-metadata">

**Author:** ![frank71](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@frank71](https://forum.babylonjs.com/u/frank71)\
**Post date:** [September 14, 2024, 3:30pm UTC](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537/20 "2024-09-14T15:30:42Z")

</div>

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

[Next page](https://forum.babylonjs.com/t/usemultiview-option-in-createdefaultxrexperienceasync-with-typescript-and-vite/52537.md?page=2)
