WebXR not feeling VR

Hello,

Is it possible that single pass rendering makes the VR feeling not feel VR anymore?
Also I have two strange black lines on my scene:

What can cause this?

Best Regards,
Léon

pinging @RaananW

Oh no… this doesn’t feel like WebXR though.

Are you using the WebVR experience helper instead of the WebXR one?

The scene does seem to render correctly, the issue is that black line which i can’t explain without a reproduction in the playground.

We’re using the WebXR experience Helper, it feels like the ceiling is crashing on your head, not very comfortable the feeling.

What device are you using to render? this feels like either VR on Android (GearVR/Daydream) or a fallback camera like the device-orientation camera.

And again, will be hard to comment regarding XR without an example. Have you tried your scene in any other XR device?

We’re using Pico G2 4K, other example scene feel like real VR but not ours

Example?

https://playground.babylonjs.com/#TJIGQ1#3

This Scene for example feels like real VR

i think an example where it doesn’t feel like VR would be much more helpful

2 Likes

@RaananW
Hello, here I have an example: https://playground.babylonjs.com/#J8PA10#5
(Need to click the Run button twice before it works)

Best Regards,
Léon

So, I am trying to understand what doesn’t feel VR in the scene -

Also, it feels like you are manipulation the camera many times, but I am not sure what exactly you are trying to do:

xrHelper.baseExperience.camera.setTransformationFromNonVRCamera(freeCam, true);

and then on the first frame:

        const initialPos = scene.getMeshByName('cam_initial')?.position;
        const rotation = scene.getMeshByName('cam_initial').rotationQuaternion.toEulerAngles();
        xrHelper.input.xrCamera.position = new BABYLON.Vector3(initialPos.x, initialPos.y, initialPos.z);
        xrHelper.input.xrCamera.rotation = new BABYLON.Vector3(rotation.x, rotation.y, 0);        
        xrHelper.input.xrCamera.ellipsoid = new BABYLON.Vector3(0.02, 0.28, 0.02);

Testing outside of the emulator, it feels like the model is scaled incorrectly - the house is simply too small, and the initial position is not correct as well (i am in the air)

@RaananW

Our model is small. And then the position of house model is not Zero.
When we create default XR experience, the camera will be placed under house.
So I tried to use the setTransformationFromNonVRCamera to transfer from non VR camera to VR camera.
But it didn’t work. And then since the house is small, I tried to change the ellipsoid of XR camera.
It seems it doeesn’t work well. I feel the floor is at my chest level.
I think the XR will set user height by detecting current user’s height but I thought that the height willl be set automatically if I use the setTransformationFromNonVRCamera or xrCamera.compensateOnFirstFrame
We need to control it by reference space? if so, could you tell me how I can do it?

I should mention that WebXR is standardized on meters. If you want 2.5 meter ceilings, the easiest way is to set your geometry that way in the program that got it created. Fixing things afterward is sometimes not worth it, and may not work the same on devices.

2 Likes

As @JCPalmer mentioned, WebXR works in very specific units (meters). Any model loaded in WebXR should be adjusted accordingly.
Now, once you have the right position in space where you want to go to, you can simply set the camera’s position to that specific position on the first frame. But it will only feel right if the model will be scaled correctly.

1 Like

@RaananW
I am trying to implement movement by touch pad of xr controller. But I have the issue with it.
The issue is that the movement is always in direction at start. so if I turn left, it will be forward direction. but it’s still left direction.
You can find the code in playground example. line 239~251
https://playground.babylonjs.com/#DB3MWJ#12

@RaananW
Hello, could you tell me what is causing that my movement is so strange?

Sure, I just can’t seem to find the time to debug the scene at the moment. The code seems ok in first look, but I haven’t tested it yet. Would also be great if you can minimize the scene to the one thing you want to test, to make sure that nothing else influences the camera in any way

@RaananW
Thank you, I reduced the code.
It’s around line 88~100 now

@RaananW
Sorry I forgot the link: https://playground.babylonjs.com/#DB3MWJ#13