Quest’s web browser now has experimental support for automatic colocated WebXR, meaning sessions involving multiple headsets in the same space.
Currently, practically achieving colocation in WebXR requires manually touching a shared reference point with either controllers or hands.
Version 39 of the Horizon OS web browser, “rolling out” now, adds a new Shared Spaces experimental setting, and enabling it lets WebXR pages automatically create a shared coordinate space among headsets in the same room.
0:00
Rik Cabanier, an engineer on Meta’s browser team, shared a short example clip of the new experimental feature in action, alongside a GitHub sample showing developers how they can use it.
The sample uses PeerJS for local networking between the headsets, and you can test it out on your own Quest at the URL sharedshooter.arvr.social.
Here’s Cabanier’s explanation of how the Shared Spaces feature works from a developer perspective:
• Each shared space is bound to size of a room. Headsets that are further away will not participate but they may start to participate if they get closer.
• A shared space is only exposed to the particular site. For instance, ‘bar.com/a.html’ will not be able to see the shared space of ‘bar.com/b.html’. They will each get a unique space and uuid.
• When the WebXR session starts, it may take a couple of seconds to establish the correct shared space. Until then, the browser will report a default shared space. After the correct one is established, the
reset
event will be called on the shared space and a new coordinate system and UUID will be established. If the headset was first to go immersive, no reset event is generated.• Participants may enter and leave at will. They will always be able to establish a common coordiante system when restarting the WebXR session. (By design, the origin of the first headset that created a shared space will be origin of the common coordinate space).
• When a partipant exists WebXR, the shared spade is lost and will need to be recreated when reentering WebXR.
• Headsets may come and go freely from the shared space, but once the last one leaves, the shared space is lost. It may be possible to recover it but we need more developer feedback on a good API shape for this.
There is a major limitation with this new Shared Spaces feature though: it only works between Quest headsets.
That’s because the feature leverages Meta’s Shared Spatial Anchors technology under the hood, and there currently is no vendor-neutral OpenXR extension for this. This limitation exists for native apps too, it’s not just the case for WebXR. Apple Vision Pro, for example, doesn’t even have shared anchors at all, while Pico also uses its own separate shared anchors system.
To enable Shared Spaces in the Horizon OS web browser, go to chrome://flags, search for “WebXR experiments”, enable it, and restart the browser.