Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
796 stars 100 forks source link

[VisionGlass] WebXR fixes #1416

Closed svillar closed 4 months ago

svillar commented 4 months ago

This PR reenables WebXR rendering in VisionGlass port. It also brings some interesting fixes like:

svillar commented 4 months ago

We can now create the WebXR session, but I think it doesn't work as it should. I've tried with Moonrider and XR Dinosaurs and in both I can observe the same issues:

1- I don't see the interstitial widget

Right I have seen that too, but I think we can handle it in a separate PR

2- Once in the WebXR session, the 3D space is too close to the user's view, so it's very difficult to interact with the world.

That's because of the patch that removes the sitting to standing transform. However that heavily depend on the experience, for example try the webxr samples.

3- The emulated controller is not synced with the mobile

I don't understand what this means. In the dinosaurs case I can use the controller to point to UI elements normally.

javifernandez commented 4 months ago

I don't understand what this means. In the dinosaurs case I can use the controller to point to UI elements normally.

I'll try to explain better the weird effect I notice on the pointer; when I move the mobile horizontally, the controller does it is diagonally. However, this happens when I rotate my perspective 90 degrees. As discussed offline, this looks like a calibration issue and indeed I managed to reproduce it in a 2D environment.

It seems that when the user's perspective is rotated 90 degrees a new calibration is needed; otherwise the error introduced will be transferred to the WebXR session.

javifernandez commented 4 months ago

I'll describe now other issues related to the positioning on the 3D world proposed in the WebXR session, specifically in the Dinosaurs XR game.

When I enter the game, my position is rotated 180 degrees in the x axis. The UI elements to select the dinosaurs are on my back. This issue forces me to move my perspective, with the corresponding calibration errors introduced by the mobile. Give that it's not possible (is this a bug ?) to calibrate the pointer inside the WebXR session, it makes the game barely usable.

svillar commented 4 months ago

I don't understand what this means. In the dinosaurs case I can use the controller to point to UI elements normally.

I'll try to explain better the weird effect I notice on the pointer; when I move the mobile horizontally, the controller does it is diagonally. However, this happens when I rotate my perspective 90 degrees. As discussed offline, this looks like a calibration issue and indeed I managed to reproduce it in a 2D environment.

It seems that when the user's perspective is rotated 90 degrees a new calibration is needed; otherwise the error introduced will be transferred to the WebXR session.

Yes that's well know. The accelerometer of the phone aggregates errors as you move away from the original location. As I mentioned this has nothing to do with being inside a WebXR session. This can be seen in the 2D environment, that's why we need recalibration.

javifernandez commented 4 months ago

But the actual problem is that the WebXR experience starts in the opposite direction; the UI elements are on my back.

svillar commented 4 months ago

Ok, lets merge this, but we need to investigate the orientation issues.

OK I'll merge the first 4 commits and leave the last one aside. It'll be part of a followup with fixes for the orientation issues.