# A vr glasses problem

**URL:** <https://forum.babylonjs.com/t/a-vr-glasses-problem/25500>\
**Category:** Questions\
**Created:** [November 23, 2021, 9:52am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500 "2021-11-23T09:52:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 9:52am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/1 "2021-11-23T09:52:41Z")

</div>

[https://playground.babylonjs.com/#SQ5UC1#283](https://playground.babylonjs.com/#SQ5UC1#283)

when I use my vr glasses(  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/c/2cf75825181cdd89fd4cda146f06a31d774fc40d.png)  
)  
It can run normally in plane mode, but when I enter to VR mode, it can not run normally, it’s dark all around.

---

<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:** [November 23, 2021, 10:15am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/2 "2021-11-23T10:15:28Z")

</div>

Adding @RaananW the master of XR

---

<div class="post-metadata">

**Author:** ![singerxt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/singerxt/32/15373_2.png) [@singerxt](https://forum.babylonjs.com/u/singerxt)\
**Post date:** [November 23, 2021, 10:25am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/3 "2021-11-23T10:25:36Z")

</div>

I don’t think PICO browser have webxr support.

---

<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:** [November 23, 2021, 10:47am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/4 "2021-11-23T10:47:14Z")

</div>

The pico 3 has firefox reality installed, if I remember correctly.

Firefox reality does support WebXR, but is not being developed further and is not fully compliant with the WebXR specs. You should also try using WebXR and not WebVR, as WebVR is deprecated and is probably not supported on your device.

Try any of the WebXR demos on the doc page, or even search for “webxr” in the playground examples when on your pico. Do those work? Is something not working correctly?

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 12:08pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/5 "2021-11-23T12:08:02Z")

</div>

Yes, I opened the page with the firefox reality app!  
I tried some pages in the pico glasses:  
[WebXR Demos and Examples | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/webXR/webXRDemos) : demos of this page can not show when I clicked the glasses icon. just have nothing around with dark gray color.

[https://playground.babylonjs.com/#TAFSN0#230](https://playground.babylonjs.com/#TAFSN0#230) : this demo can show normal in vr mode.

---

<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:** [November 23, 2021, 12:26pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/6 "2021-11-23T12:26:07Z")

</div>

What version of firefox reality is installed on your device?

This demo is a webvr demo, which is an API that was deprecated in (and removed from) most browsers almost a year ago.

Can you debug the scene? see why it fails? can you check if navigator.xr is present?

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 12:30pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/7 "2021-11-23T12:30:17Z")

</div>

Firefox Reality 12.2  
2020.12.15

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 12:37pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/8 "2021-11-23T12:37:45Z")

</div>

I just run a simple script: alert(window.navigator.xr);  
It alert: [object XRSystem]

---

<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:** [November 23, 2021, 12:41pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/9 "2021-11-23T12:41:24Z")

</div>

that means XR is present, but this is a very old version of the API (if it was built almost a year ago).

it’s very hard to debug without having a device. do you have access to the console? are there any errors that are shown when you try opening a simple XR scene?

Also - can you check if there is an xr flag somewhere in about:config? is it enabled?

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 12:44pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/10 "2021-11-23T12:44:02Z")

</div>

I input `about:config` in the url, it does not work!

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 23, 2021, 12:49pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/11 "2021-11-23T12:49:47Z")

</div>

I’m not very familiar with the debugging inside the device,  
Tomorrow I will ask my colleagues, and then I will reply to you, they are all off work today.  
Thanks!

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 24, 2021, 2:11am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/12 "2021-11-24T02:11:10Z")

</div>

Babylon.js v5.0.0-alpha.61 - WebGL2

The pic is not clear, so I typed the main error msg:

```auto
TypeError:can‘t access property 'finalPointerUpTriggered',t_controllers[e] is undefined
/vr/babylon-framework/babylon.js:16:2390742 fl</t.prototype._detachController/<@https://domain/babylon.js:16:2390742
a</e.prototype.notifyObservers@https://domain/babylon.js:16:17799
U<t.prototype.render@https://domain/babylon.js:16:274871
init/<@https://domain/demo:129:17
f</t.prototype._renderFrame@https://domain/babylon.js:16:141510
f</t.prototype._renderLoop@htts://domain/babylon.js:16:141696
Mi</e.prototype.initializeSessionAsync/</@https://domain/babylon.js:16:1467411

```

the main script

```auto
<script>
      const init = async () => {
        const canvas = document.getElementById("renderCanvas"); // Get the canvas element
        const engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine

        var createScene = async function () {
          // This creates a basic Babylon Scene object (non-mesh)
          var scene = new BABYLON.Scene(engine);

          // This creates and positions a free camera (non-mesh)
          var camera = new BABYLON.FreeCamera(
            "camera1",
            new BABYLON.Vector3(0, 5, -10),
            scene,
          );

          // This targets the camera to scene origin
          camera.setTarget(BABYLON.Vector3.Zero());

          // This attaches the camera to the canvas
          camera.attachControl(canvas, true);

          // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
          var light = new BABYLON.HemisphericLight(
            "light",
            new BABYLON.Vector3(0, 1, 0),
            scene,
          );

          // Default intensity is 1. Let's dim the light a small amount
          light.intensity = 0.7;

          // Our built-in 'sphere' shape.
          var sphere = BABYLON.MeshBuilder.CreateSphere(
            "sphere",
            { diameter: 2, segments: 32 },
            scene,
          );

          // Move the sphere upward 1/2 its height
          sphere.position.y = 1;

          scene.createDefaultEnvironment();

          // XR
          const xrHelper = await scene.createDefaultXRExperienceAsync();

          return scene;
        };

        const scene = await createScene(); //Call the createScene function

        // Register a render loop to repeatedly render the scene
        engine.runRenderLoop(function () {
          scene.render();
        });

        // Watch for browser/canvas resize events
        window.addEventListener("resize", function () {
          engine.resize();
        });
      };

      init();
    </script>

```

 ![616a374ee3d35a1e8c99d3c9a0a4d9c1](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/4/34c0ef907257d10cc755471f9cdd94a5735a130d.jpeg)

I use the vConsole in the page: [https://github.com/Tencent/vConsole](https://github.com/Tencent/vConsole)

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 24, 2021, 2:21am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/13 "2021-11-24T02:21:23Z")

</div>

```auto
    <!-- Dependencies -->
    <script src="../../babylon-framework/ammo.js"></script>
    <script src="../../babylon-framework/recast.js"></script>
    <script src="../../babylon-framework/cannon.js"></script>
    <script src="../../babylon-framework/Oimo.js"></script>
    <script src="../../babylon-framework/earcut.min.js"></script>

    <!-- Babylon.js -->
    <script src="../../babylon-framework/babylon.js"></script>
    <script src="../../babylon-framework/materialsLibrary/babylonjs.materials.min.js"></script>
    <script src="../../babylon-framework/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
    <script src="../../babylon-framework/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
    <script src="../../babylon-framework/loaders/babylonjs.loaders.min.js"></script>
    <script src="../../babylon-framework/serializers/babylonjs.serializers.min.js"></script>
    <script src="../../babylon-framework/gui/babylon.gui.min.js"></script>
    <script src="../../babylon-framework/inspector/babylon.inspector.bundle.js"></script>
    <script src="../../babylon-framework/nodeEditor/babylon.nodeEditor.js"></script>
    <script src="../../babylon-framework/guiEditor/babylon.guiEditor.js"></script>

```

The scripts I use is the same as babylonjs playground which I cloned from github store under the `dist/preview release` folder

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 24, 2021, 5:46am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/14 "2021-11-24T05:46:44Z")

</div>

[https://www.babylonjs.com/demos/glowingespilit/](https://www.babylonjs.com/demos/glowingespilit/)  
this demo works fine when vr mode.

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 24, 2021, 6:26am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/15 "2021-11-24T06:26:12Z")

</div>

aha, I know how to shot the vr screen, there is a relative clear screenshot pic:

 ![Screenshot_org.mozilla.vrbrowser_2021.11.24-14.22.57.371_068](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/8/f86b5baf3eb552aa5d6a508a8ecadfde2a24039a.jpeg)

---

<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:** [November 24, 2021, 12:32pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/16 "2021-11-24T12:32:56Z")

</div>

Oh! that looks like a bug that was recently introduced (by me…). Let me fix that. Can you try an earlier babylon alpha version? something like alpha.50? just to see if it’s a regression.

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 25, 2021, 1:29am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/17 "2021-11-25T01:29:23Z")

</div>

```auto
<script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/5.0.0-alpha.50/babylon.js"></script>

```

Yes, I replaced with this cdn file, then it works fine!

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 25, 2021, 1:36am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/18 "2021-11-25T01:36:38Z")

</div>

Then I changed the createScene code to the code of `https://playground.babylonjs.com/#SQ5UC1#283`  
the videoDome works fine too!

---

<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:** [November 25, 2021, 11:15am UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/20 "2021-11-25T11:15:52Z")

</div>

I have fixed it yesterday and the fix was merged. The next npm release (alpha.62) will contain the fix.

Thanks for reporting the bug!

---

<div class="post-metadata">

**Author:** ![99999](https://avatars.discourse-cdn.com/v4/letter/9/a183cd/32.png) [@99999](https://forum.babylonjs.com/u/99999)\
**Post date:** [November 25, 2021, 2:46pm UTC](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500/21 "2021-11-25T14:46:02Z")

</div>

![Screenshot_org.mozilla.vrbrowser_2021.11.25-22.33.54.318_345](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/3/5364c8987f85a434a395d45b1113d0495c5b5053.jpeg)  
I use the latest preview version, but the error still exist.

[Next page](https://forum.babylonjs.com/t/a-vr-glasses-problem/25500.md?page=2)
