Can I use the dom-overlay feature in AR

DOM overlay feature is compatible in BABYLON WEBXR AR mode?

Adding @RaananW

Not yet officially included in babylon.js. You could of course implement it yourself, as we expose all of the native XR objects, but if you want to wait until we have the feature you can track its progress here - [XR] Experiment with and implement the DOM Overlay feature · Issue #8996 · BabylonJS/Babylon.js (

Should I add DOM overlays as optional features something like this?

navigator.xr.requestSession("immersive-ar", {
        optionalFeatures: ["dom-overlay"],
        domOverlay: { root: document.getElementById("overlay") }

How can i get the right native XR object? And add this optionalFeatures?
I use createDefaultXRExperienceAsync() function.

Or should I wait for the 5.0 release, how soon will it be? :grinning:

can’t promise anything :slight_smile:

I didn’t look into it. You will need to add the feature name, that’s for sure, but if extra elements are required to be added to the session init options you might need to start the session yourself (using the XR Helper insterad of the default experience, or directly the XRSessionManager).

I might find time next week to look into and and maybe offer a preliminary feature implementation.

It will be great!)

1 Like