WebXR without going fullscreen?

Is it possible to start a WebXR session without going into fullscreen mode?

I’ve been playing around with trying to get a WebXR session to start without going into fullscreen mode, so I can keep some html elements around the canvas, but I’ve had no luck far.

I’ve tried it with engine._ExitFullscreen(), but either nothing happens or it goes into into fullscreen mode, but the camera view is just black, depending on where I call the function.

cc @RaananW

The quick answer is… nope :slight_smile:

WebXR is actually not running in “fullscreen”. It uses a different framebuffer that passes to the headset. So you can’t see the HTML elements the canvas is located at, as the canvas is not being used to render the scene. On AR mobile scenarios you can use the DOM overlay feature (Babylon.js docs) to display HTMl elements on top of your single-view XR session.

Thanks for the answer, I figured it would be like this. I only asked, because I’m still trying to work around problem where the input element causes the whole DOM overlay to flicker when typing.
I found quite a few problems with DOM overlay during my testing, but as far as I can tell, none of them are related to BabylonJS, and Google developers have better things to do, than work on this ::

1 Like

Well, a bug is a bug! Did you submit it to the chromium issue tracker?

I know it’s not exactly what you’re asking, but for many cases the GUI/GUI3D controls will give rough equivalent to what you can do in html/js. Lotsa limitations, but if you want input controls I’ve ended up extending/cloning these versus trying to use html overlays. More cognitive overhead because it’s completely independent of normal HTML forms/controls, but more control over experience in immersive mode (even if you could do overlays, which you can’t really do as mentioned above, it’d be a potentially weird experience to have a static frame around an immersive scene (i.e. how far away should it be?, where in the scene? Should it be a HUD that tracks with your head (this can be VERY disconcerting). One alternative approach I’ve also done it make a react overlay and display the scene “non immersive” but give the option to “go immersive”. An example of that (not code, just the experience) would be on https://www.immersiveidea.com (it’s not using babylon, but you can do the same thing)… if you look at the example scene in the lower left, it’s rendered in 3d and is navigable, but…of course once you launch into VR (by clicking the button) the outer “flat” html is gone.