Igalia / wolvic

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

[OpenXR] Add basic support for WebXR AR module #1507

Closed svillar closed 2 months ago

svillar commented 3 months ago

Wolvic can now start and render WebXR's immersive-ar sessions for those devices supporting passthrough, either via non-opaque blend modes or passthrough compositor layers.

This requires a few changes in the communication protocol with the web engine:

  1. pass the available blend modes to the web engine so it can select the desired one depending on the requested WebXR session.
  2. use the selected blend mode from the web engine to render the immersive scene
  3. notify Wolvic about the type of WebXR session (AR/VR)

Change #3 is required for those devices that do support passthrough but not via AR blend modes. Examples of those are the Meta devices that implement passthrough via a passthrough compositor layer.

Note that WebXR's session type will prevail over the current passthrough status in standalone mode. There are 4 different scenarios (PT stands for passthrough):

  1. PT ON, VR session: PT will be disabled on entering and reenabled on exiting
  2. PT ON, AR session: PT will be activated all the time
  3. PT OFF, VR session: PT will be off all the time
  4. PT OFF, AR session: PT will be activated on entering and reenabled on exiting

This change requires https://github.com/Igalia/wolvic-chromium/pull/114 which implements the required bits on the Chromium backend.

Fixes #242

svillar commented 3 months ago

Note that this is increasing the version of the protocol used to talk to the Web Engine during WebXR sessions. This means that this change breaks WebXR support. We need to land the chromium backend change and also upload a new patch for Gecko to adapt it to work with this new protocol version.

svillar commented 2 months ago

This change requires https://github.com/Igalia/wolvic-gecko-patches/pull/5, otherwise WebXR will break in the Gecko backend