Skip to content

WebXR ​

The WebXR host is a browser-wasm host with Godot's WebXR capabilities enabled and the WebXR Layers polyfill included. It is single-threaded: --web-threads applies only to Web and Blazor hosts.

See WebXR Configuration for build and publish settings.

Use It ​

Run these commands from your Godot project directory. If wasm-tools is missing, accept the offer from add to install it:

bash
dnx 2dog add --webxr
dotnet publish MyGame.webxr

Serve the site:

bash
dnx dotnet-serve -- -d MyGame.webxr/AppBundle

Set Up Your Scene ​

Enable web XR shaders in project.godot:

ini
[xr]
shaders/enabled.web=true

Add an XROrigin3D with an XRCamera3D. Start Godot's WebXRInterface when the user presses a button. When the session starts, enable Viewport.UseXR. See the showcase scene for an example.

Use an XR-capable browser and device, or the Immersive Web Emulator. If you do not serve the site from localhost, use HTTPS. The Web host's limitations also apply.

2dog is Free and Libre Open Source under the MIT License.
2dog is not affiliated with or endorsed by the Godot Foundation.
Godot is licensed under the MIT License; the Godot logo is by Andrea Calabró under CC BY 4.0. @icons made by Voxy under the MIT License.
Continuous Integration compute graciously supported by Blacksmith.