immersive-web / webxr

Repository for the WebXR Device API Specification.
https://immersive-web.github.io/webxr/
Other
2.98k stars 382 forks source link

Some WebXR Implementations pause the 2D browser page in XR, make this optional? #1317

Open AdaRoseCannon opened 1 year ago

AdaRoseCannon commented 1 year ago

Some WebXR Implementations pause the 2D browser page in WebXR, this is a performance improvement and is technically correct since the page isn't visible. Unfortunately it can cause issues if you are tying bits of your WebGL scene to DOM based animations and transitions. The ability to opt out of this behaviour would be handy for developers.

Related #1316 since this would also keep the animations running.

/agenda to discuss.

AdaRoseCannon commented 1 year ago

/facetoface lets talk about this at the face to face

emmanueljl commented 1 year ago

Do you have a link to a WebXR app that does this? The system keyboard integration, for example, is dependent on interacting with a text input element on the page. I'd like to test whether that has issues with this "pausing".

mkeblx commented 1 year ago

Here's a basic example page where a CSS animation value is used to drive a WebXR object's position. https://mkeblx.github.io/css2webxr/

This fails to work in WebXR if the WebXR implementation pauses the 2D browser page (e.g. like Meta Browser currently). On desktop you can see the working scenario using the Immersive Web Emulator.