Teleportation leaves changes to XR session that persist after exiting babylon, prevent re-entering babylon immersive mode until reboot

Hi @RaananW - came across something strange when testing with SteamVR (Index) + Chrome + Babylon.

Normally, after exiting any VR experience, when SteamVR home reloads, I find myself back at the same location I left from.

With WebXRFeatureName.TELEPORTATION however, that is not the case. I come back stuck inside the ground or outside the building. I am also unable to reenter a babylon XR session properly, getting either a glitched out scene that doesn’t update with head movement or no XR session and an error in the enter XR icon. I have to restart SteamVR to restore normal functioning.

I can reproduce this in the basic example playground: Babylon.js Playground

Steps:

  1. Enter the scene
  2. Teleport onto the top platform and all the way to the end of it
  3. Exit VR
  4. Observe the home enviroment is offset

I recall you mentioned in our previous thread that you’re accomplishing teleport via changing the XR session parameters. I was surprised to learn this as it’s now how I’ve done it before in threejs-based experiences (i.e. parenting the camera and controllers in a transform node and moving the node). Seems very likely related to this

1 Like

pinging @RaananW

Hey!

Let me make sure I understood correctly - when you leave a Babylon.js scene back to StreamVR your position in the StreamVR app is not the position you left from initially, but a new position (which I assume is the relative position you were at in the babylon scene)?

Can I ask you to check something - does it happen when entering (, then teleporting and leaving) this scene - Teleportation (immersive-web.github.io) ? It practically uses the same mechanism as we do.

This is odd, as this functionality basically tells the current session so use a different reference space to calculate the camera’s position. it is no more than telling XR to connect the camera to a parent at a specific location. So the camera is relative to this position in space. But(!) this reference space is only stored in babylon and is being used with every call to get the new camera’s pose. it is just a way for us to keep track of your relative position… Usually I will say that this is our fault, but it feels like an incorrect session init on StreamVR side. I will have to test further to be sure. I don’t have an index (and we already established that firefox will be of no use), so I will have to find a workaround for this.

Can you also try this - Babylon.js Playground

At session end I set the reference point used by babylon to the base reference point (original position), and get an offset of 0,0,0 from me, practically saying - transform to nowhere in this reference). This might throw an exception on certain systems. There is no “pre-end” event, so it only makes sense to call it there. Thou the scene has technically already ended, so i am not sure what xr will make of it.

BTW - the function we are using is this - WebXR Device API (immersive-web.github.io).

@RaananW thanks for the replies - sorry I’ve been tied up. Just got a chance to test and I was able to reproduce in the immersive web demo scene. Might just be a system issue then. Going to do some clean installs and try again. Thanks also for the documentation link - I see now that is intended as a navigation feature. Very cool.

1 Like

FYI @RaananW I found this issue of not being able to re-enter immersive session in Chrome/SteamVR does affect others and there’s a Chrome bug tracking it: 1354399 - chromium - An open-source project to help move the web forward. - Monorail

stars on that issue are much appreciated!

4 Likes

It got my star

1 Like