meta-quest / immersive-web-emulator

Browser extension that emulates Meta Quest devices for WebXR development. Lead: Felix Zhang (fe1ix@meta.com)
https://developer.oculus.com/blog/webxr-development-immersive-web-emulator/
MIT License
297 stars 34 forks source link

Simulator does remove canvas from custom web components and after session the canvas is not in the document anymore #55

Open marwie opened 6 months ago

marwie commented 6 months ago

Hello, currently when ending the XRSession the renderer seems to be broken.

It works as expected on device returning to the original rendering state

https://github.com/meta-quest/immersive-web-emulator/assets/5083203/477f4b86-b2ca-46c1-a176-d51abc198134

marwie commented 6 months ago

Oh seems to be related to our project

marwie commented 6 months ago

Hi - so it seems the issue is related to the canvas being a child of a shadowRoot container with a custom web component. See the glitch project for reproducting it here: https://zircon-sunset-singer.glitch.me/ (you can exit XR using the ESC key)

Here's the code: https://glitch.com/edit/#!/zircon-sunset-singer?path=index.html

This might even be an issue inside three.js - I will update this issue if I have any more information

I even get 2 canvases that are reparented to the root document when the XR session starts

https://github.com/meta-quest/immersive-web-emulator/assets/5083203/babf1b4e-fa2d-4427-a789-904a5ff893ef

and when the session ends the canvas gets removed from the document altogether

https://github.com/meta-quest/immersive-web-emulator/assets/5083203/ea0437aa-104f-4b0a-b4f4-affe2d938895

marwie commented 6 months ago

This doesnt happen when using Quest with Link