WebXR DOM Overlay in 3D
TPAC 2020-11-04
Klaus Weidner / klausw@google.com
Status update
Spec: Editor’s Draft 2020-06-04� https://immersive-web.github.io/dom-overlays/
Explainer: � https://github.com/immersive-web/dom-overlays/blob/master/explainer.md
Implementation
Chrome on Android: since v84+ for handheld AR
Used by <model-viewer> and other WebXR AR sites. Use case examples:
WebXR DOM Overlay examples
Use Case: Annotations
Overlay types: XRDOMOverlayType
See [specification]:
Annotations in 3D viewed on a headset
The visual appearance of a floating overlay is similar to a flat glass pane in between the user and model, and annotations would appear as moving stickers on that pane.
If an app such as <model-viewer> places annotations in the DOM overlay assuming a screen type, the position would be inaccurate on a floating overlay.
There’s some degree of graceful degradation. Annotations would still be near the expected location as long as the floating overlay’s size is similar to the rendered viewport.
Potential improvements to a floating overlay
If the applications knows the overlay location in 3D space, it could provide more accurate locations within the single-plane constraint.
Spec NOTE: Future versions of this spec may add additional attributes to the overlay state, for example the current location in world space for a floating overlay.
Optionally, draw 3D connecting lines from the model to the corresponding annotation?
Option: stereoscopic DOM?
If the DOM content could be rendered differently for the left and right eye, the application could use this to place content at 3D positions.
The content would still be constrained to a pyramid/frustum with extent defined by the floating quad’s boundary.
Handwave: CSS :left-eye / :right-eye pseudo-classes?
Per-eye positions causes ambiguity for DOM hit test.
Implementation challenges?
Option: multiple DOM layers in 3D?
Advantages: very flexible.
Downsides: implementation challenges, input / security seems hard to get right.
Feasible for display-only DOM layers with no interactivity? The app would need to do its own hit testing and interactions.
Links
Model selection: https://modelviewer.dev/examples/augmentedreality/index.html
Shoe: https://www.khronos.org/blog/live-gltf-asset-editing-in-your-browsereven-in-ar
Astronaut with annotations: https://modelviewer.dev/examples/annotations/index.html