Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VisionGlass] WebXR fixes #1416

Merged
merged 4 commits into from May 13, 2024
Merged

[VisionGlass] WebXR fixes #1416

merged 4 commits into from May 13, 2024

Conversation

svillar
Copy link
Member

@svillar svillar commented May 8, 2024

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

  • controller has now a valid position in WebXR
  • a 3D model of the controller is shown (from the WebXR registry) if none is rendered by the experience
  • removed the sitting to standing transform which was moving the head position way too high

WebXR scenes were not rendered in the VisionGlass since 0f55393.
The regression was caused by an error specifying the FoV of the
immersive display. We were incorrectly using negative sizes for left
and bottom as they must be positive. The code is smart enough to
compute the FoV in the four directions using absolute figures.
No engine supports the VisionGlass as it has no controllers. We're
faking a controller with the phone. Let's just use the Focus 1
controller model as we have been using for HVR.
The controller was not shown in WebXR sessions. It was actually not
possible to interact with any experience. The problem was that
we were not setting position capabilities to the controller and
thus we were not passing that information to the engine (even if
the position is emulated as the phone is a 3DoF device).
After this change the controller can be seen in WebXR.

Also we're setting the number of buttons in the controller to 1
to let experiences adapt to a controller with just one button.
Similar to HVR 3DoF we're using the HAND_NONE version.
Copy link
Member

@javifernandez javifernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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.
3- The emulated controller is not synced with the mobile

@svillar
Copy link
Member Author

svillar commented May 9, 2024

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

svillar commented May 9, 2024

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
Copy link
Member

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

Copy link
Member

@javifernandez javifernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@svillar
Copy link
Member Author

svillar commented May 13, 2024

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.

@svillar svillar merged commit b5a787c into main May 13, 2024
20 checks passed
@svillar svillar deleted the visionglass_webxr branch May 13, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants