WebXR immersive mode stopped working on latest babylonjs preview

Hi, @RaananW think I may have found a bug when launching WebXR immersive mode on 5.0.0-alpha.40:

Steps to reproduce:

  1. Load the physics playground XR demo: https://playground.babylonjs.com/#B922X8#19

  2. If you are on desktop, have the XR emulator installed and click on the glasses icon in the lower right to enter immersive mode.

  3. The playground becomes a white screen and there is a js console error, see screen shot.

TypeError: Cannot read property 'textures' of null
    at e._createRenderTargetTexture (babylon.js:16)
    at Object.getRenderTargetForEye (babylon.js:16)
    at e.getRenderTargetTextureForEye (babylon.js:16)
    at babylon.js:16
    at Array.forEach (<anonymous>)
    at t._updateFromXRSession (babylon.js:16)
    at r.callback (babylon.js:16)
    at e.notifyObservers (babylon.js:16)
    at Object.renderFunction [as callback] (babylon.js:16)
    at XRSession$1.<computed>.onDeviceFrame (<anonymous>:1281:42)

Version of the playground is 5.0.0-alpha.40, if you switch to 4.2 the error does not happen.

P.S.,

I discovered this on my website which uses the preview scripts, and I have tested this on Oculus 1 and 2, both of which crash and cannot load immersive mode.

1 Like

Checking that asap!

Thanks for reporting

I am able to enter XR without a problem. Does it fail with the latest playground?

Ok! got it, let’s see what happened.

[XR] adjusting to the new RTT procedure by RaananW · Pull Request #10965 · BabylonJS/Babylon.js (github.com)

fix is coming up

2 Likes

wow super fast response! thanks for looking into this so quickly

1 Like