For our mobile and desktop scenes we show/hide DOM elements using CSS when interactivity is needed. This works real well. We want to do the same for HMDs.
when the webxr dom overlay feature was implemented, it was only supported in AR scenarios. There is now a comment in the specs, saying “Implementation choices include a fullscreen overlay on a handheld AR device, or a floating rectangle in space for a VR or AR headset.”. I am not sure, to be honest, which VR device supports DOM overlay. but we can enable it for VR sessions, of course.. We don’t imit WebXR DOM Overlay based on session mode. So - you can use it in VR, if the device supports it.
But I do like @carolhmj’s suggestion to use the GUI. no fullscreen support, but you can attach GUI to a mesh or use the 3D GUI elements
For a historical reference, Feature 'dom-overlay' is not supported for mode: immersive-vr says com.oculus.browser (OculusBrowser/31.1.0.14.26.554554223 SamsungBrowser/4.0 Chrome/120.0.6099.144) as it fails to stat the session – if requested to start an immersive-vr session with requiredFeatures: ["dom-overlay"] an up-to-date Meta Quest 2.
If today or in future someone finds a device/browser combination out there that has implemented and enabled support for dom-overlay in immersive-vr session, please update this and all other threads on this so that we are first to find out Stable or nightly, by default or behind a flag - any support goes.
I am not aware of any as of today, though the W3C spec doesn’t seem to be in a good enough shape for the vendors to implement just yet (in the dom-overlay & immersive-vr aspect specifically).
That’s mostly a browser feature, so I sadly don’t have an update here. I wouldn’t expect DOM Overlay to be supported in VR scenes. But you can now use fullscreen GUI now! if the browser supports layers :-).
There are the open XR issues. Some are marked to be in 8.0, some are marked as future, which means they will probably take a little longer, unless they will be requested directly before: