Godot XR Development: A Practical OpenXR Guide
What you need before you write any code
Godot builds XR applications with the same engine you use for flat games. There is no separate XR fork and no paid add-on required to reach a headset. The stable release at the time of writing is Godot 4.7.2, with 4.8 in beta, and OpenXR support lives inside the core engine.
The practical checklist is short:
- Godot 4.7 or newer, standard build.
- A headset and its runtime (SteamVR, the Quest’s native OpenXR client, or an Android XR runtime).
- For standalone Android headsets: OpenJDK 17, Android Studio, and the Android SDK path configured in Godot’s editor settings.
- Optionally, the Godot XR Tools add-on for locomotion, grabbing and UI interaction.
Everything below assumes a fresh 3D project. It is written against the 4.7 documentation, so if you are on an older 4.x release, check the version selector before copying settings.
How Godot’s XR layer fits together
Godot keeps platform specifics behind a small abstraction. The XRServer is the central hub, and each supported platform is implemented as an XRInterface. Interfaces register themselves at startup and you initialize the one you want. Only one interface can drive output at a time, which is why Godot supports a single headset per session.
The OpenXR interface is the one that matters for most projects. OpenXR is the Khronos cross-platform XR API that Quest, SteamVR, Android XR and most PC headsets all speak, which means one project can target several devices without a per-vendor code path.
Three node types appear in nearly every XR scene:
XROrigin3Dis the center of the tracked play space. Everything the runtime tracks is positioned relative to it.XRCamera3Dis the stereo camera. The runtime moves it; you do not drive it with mouse look.XRController3Drepresents a controller or hand-held device, with signals for buttons, triggers and haptics.
There is an important architectural consequence. For standalone devices, the XRInterface takes over final output and Godot’s normal window output is disabled. For desktop headsets that act as a second display, you can dedicate a separate Viewport to XR and keep the main window for something else.
Turn OpenXR on before you build the scene
OpenXR is a module that has to be enabled when the engine starts, not at runtime. In Project Settings, open XR > OpenXR and tick Enabled. Then open XR > Shaders and tick Enabled as well, and press Save & Restart.
The reason is not bureaucracy. The Vulkan implementation of OpenXR is tightly integrated with Vulkan itself and takes over parts of the rendering system, so the interface has to be present before the renderer finishes setting up. If you skip this, initialization fails and you get a flat window with no headset output.
You can also force the mode from the command line with --xr-mode on, which is useful for automated test runs.
Pick the renderer deliberately
Godot offers three renderers: Compatibility (OpenGL), Mobile (Vulkan) and Forward+ (Vulkan). For XR the choice used to be genuinely awkward. It is less awkward now.
The 4.7 release notes state that Vulkan subsampled images dramatically improve foveated rendering in the Mobile renderer, because reduced-resolution tiles are stored at their reduced size instead of being upscaled into texture memory. With that change the Mobile renderer matches or beats Compatibility in a number of benchmarks, and the team now recommends Mobile for new XR projects. The setup documentation already recommends Mobile for desktop VR and for standalone headsets like Quest 3, and notes that Forward+ works but is not well optimized for XR.
There is one live contradiction worth knowing about. The Android deployment page still warns that the Mobile Vulkan path has rough edges on Android-based headsets and advises the Compatibility renderer “for the time being”. That page has not caught up with 4.7. Treat Mobile as the default, and test Compatibility on your actual target hardware before you commit to a look.
Build the tracking rig
Create a scene with an XROrigin3D at the root, then add an XRCamera3D and two XRController3D nodes as children of the origin. Rename the controllers LeftHand and RightHand and assign each one its left or right hand tracker in the inspector.
To make the scene editable rather than only testable in a headset, set the camera’s Y to 1.7 and place the controllers around (-0.5, 1.0, -0.5) and (0.5, 1.0, -0.5). Those positions are editor conveniences; at runtime the inside-out tracking system supplies the real poses and the runtime overwrites them every frame.
If you want optical hand tracking, the setup is a separate path. Enable hand tracking in project settings (and in export settings for devices like Quest), then add three things per hand: an XRNode3D with its tracker set to the left or right hand tracker path, a hand mesh rigged to the Godot humanoid skeleton, and a skeleton modifier that applies the finger data. Godot standardizes this on the humanoid skeleton, and the same scene works under WebXR.
Wire input through the XR action map
Do not try to read XR controllers through Godot’s normal InputMap. The engine deliberately has a second system for this, the XR action map, and the documentation is explicit about why: OpenXR hides raw device data and only hands back parsed action data, OpenXR does not allow rebinding at runtime, and device IDs in Godot’s input system are meaningless to OpenXR.
The model is sets and actions. An action set groups bindings for one context, for example character movement, vehicle control or an open menu, and only one set should be active when the same physical input is bound to different actions in each. For a first project, build a single set and resist the urge to over-engineer.
Godot generates a default action map if none exists. Do not ship it. That map exists to help port Godot 3 projects and binds essentially every input on every supported controller one to one. The 4.7 release did simplify it considerably by adding the OpenXR generic controller profile, cutting the defaults down to the generic, Touch, Pico 4 and hand interaction profiles, but a purpose-built map is still the right starting point.
Handle the session events people forget
The minimal startup script in the docs initializes the interface and stops there. The “better XR start script” page adds the parts that matter in production:
focus_lostandfocus_gained, emitted when the player removes the headset or opens the system menu. Pause gameplay and audio on the first, resume on the second.pose_recentered, emitted when the player recenters. If you use thestagereference space, the runtime will not move your origin for you. You have to callXRServer.center_on_hmd()yourself. The documentation is blunt that failing to handle this will prevent your application from being accepted on various stores.- A maximum refresh rate value, applied through the OpenXR interface after initialization.
Reference space choice drives that last part. local puts the origin at the player’s head when the session starts, which suits cockpit games. local floor keeps the player’s height, which suits standing experiences and AR. stage puts the origin at the center of the guardian boundary and is the right default for room scale.
Add locomotion, grabbing and UI with XR Tools
Godot gives you tracking and rendering. It does not give you a movement system, a grab system or a wrist menu. That is what Godot XR Tools is for: it implements the mechanics most XR games need, from locomotion to object interaction to UI interaction, and it is designed to work with both OpenXR and WebXR.
Install it by taking the addons folder from the latest godot-xr-tools.zip release, or from the Asset Store, then enable the plugin in Project Settings and reopen the project. Expect some “failed to load script” messages before you enable it; that is normal.
Two practical notes. First, check version compatibility: XR Tools 4.5.x requires Godot 4.4 or newer, while older 4.x releases of the add-on go back to Godot 4.0. Second, add the misc/VR_Common_Shader_Cache.tscn scene as a child of your XRCamera3D. XR Tools hides and reveals objects constantly as the player acts, and without the cache the first reveal stalls while Godot compiles the shader.
Export to a headset
For standalone Android headsets, do the general Android setup first: OpenJDK 17, Android Studio, and the SDK location in Godot. Then, in the project, choose Install Android Build Template from the Project menu to create the android folder with the Gradle build files.
Install the OpenXR vendors plugin from the Asset Store (search “OpenXR vendors”) or from its release page, and copy the godotopenxrvendors addon into your addons folder. Since Godot 4.6 this plugin is optional but recommended: the engine can export to most Android-compatible devices directly, but vendor extensions, vendor-specific export options and store releases depend on it.
Then create one export preset per device. Enable Use Gradle Build, set XR Mode to OpenXR, pick the vendor feature entry for your headset if it appears (otherwise the Khronos plugin), and keep Runnable on if you want one-click deploy.
For Android XR specifically, Google’s own guidance is to target minimum SDK 34, configure the export preset for spatial rendering, and use one-click deploy to test on device. Android XR is Google’s platform for headsets and wired glasses, and it is worth reading its constraints before you design the session flow. On the publishing side, immersive apps on Google Play have their own quality guidelines, and Godot 4.7’s Android Build Environment (GABE) now lets you export and publish from an Android device.
Steam Frame is the other target that changed recently. Godot 4.7 shipped with production-ready Steam Frame support, and it is the engine behind part of the XREAL AURA launch lineup.
Where the frames actually go
XR performance work is mostly about bandwidth and fill rate, not polygon count. Three things pay off in Godot:
Foveated rendering. On the Mobile and Forward+ renderers, set the viewport’s vrs_mode to VRS_XR. On hardware that supports it, this drops shading rate in peripheral tiles, and with 4.7’s subsampled images the memory savings are real rather than theoretical. On Compatibility you configure foveated rendering through the OpenXR settings instead, and Godot will warn you if it is unset.
Composition layers. Do not put flat UI straight into the 3D scene. Render it to a SubViewport and present it through OpenXRCompositionLayerQuad, Cylinder or Equirect. The runtime projects these after lens distortion, which keeps text legible instead of smeared. Three caveats: support varies by runtime, Godot falls back to normal rendering when unsupported, and a layer presented by the runtime will not appear in a desktop spectator view.
Refresh rate. OpenXRInterface.display_refresh_rate and get_available_display_refresh_rates() are exposed, but only after initialization and only when the runtime supports the extension. Listen to refresh_rate_changed so your frame budget logic follows what the headset is actually doing.
Is Godot ready for your XR project?
For OpenXR work, yes. One codebase reaches Quest, SteamVR, Android XR and Steam Frame, the core is MIT licensed, and 4.7 added day-one support for two platforms that Unity and Unreal also targeted. Godot was also in the launch lineup for XREAL’s AURA glasses, which is a stronger signal than a benchmark.
The honest gaps are tooling depth and vendor SDK coverage. Forward+ is not XR-optimized, some post-processing effects still break in stereo, and vendor-specific features arrive through the OpenXR vendors plugin rather than the engine. If your project depends on a vendor’s proprietary SDK, verify that path before you commit.
If you are still choosing an engine, the Unity, Unreal and Godot comparison covers the tradeoffs in more detail, including where each one’s OpenXR support actually ends.
Sources
- Godot Engine: download page, current stable 4.7.2
- Godot Engine 4.7 release notes: Android XR and Steam Frame support, Vulkan subsampled images, composition layer and action map changes
- Godot docs: Setting up XR (XRServer, interfaces, nodes, renderer guidance)
- Godot docs: Deploying to Android (Gradle template, vendors plugin, per-device presets)
- Godot docs: The XR action map (sets, actions, default map warning)
- Godot docs: A better XR start script (focus, recenter, refresh rate)
- Godot docs: OpenXR settings (reference spaces, recenter requirements)
- Godot docs: OpenXR hand tracking (XRNode3D, humanoid skeleton, WebXR parity)
- Godot docs: OpenXR composition layers (Quad, Cylinder, Equirect, fallback)
- Godot docs: Introducing XR Tools (install, plugin, shader cache)
- Godot XR Tools repository (version compatibility table)
- Android Developers: Develop with Godot for Android XR (minimum SDK 34, vendors plugin, Play guidelines)
- Godot docs: OpenXRInterface class reference (display_refresh_rate, get_available_display_refresh_rates, refresh_rate_changed)
Frequently asked questions
- Does Godot support VR and XR out of the box?
- Yes. Godot ships an OpenXR interface inside the core engine, alongside a WebXR interface, so you do not need a third-party VR plugin to start a headset project. You do need to enable OpenXR in the project settings before the engine starts.
- Which renderer should I use for a Godot XR project?
- Use the Mobile renderer. The Godot 4.7 release notes recommend it for new XR projects because Vulkan subsampled images make foveated rendering much cheaper. Forward+ still runs XR but is not well optimized for it, and the Android export docs still advise testing the Compatibility renderer on standalone headsets.
- Can I build Meta Quest games in Godot without extra plugins?
- You can export a working OpenXR build with the core engine. Since Godot 4.6 the OpenXR vendors plugin is optional but recommended, and it is required for vendor-specific extensions, vendor features in the export panel, and app store releases.
- How do I change the refresh rate in Godot XR?
- Read the OpenXRInterface display_refresh_rate property, or call get_available_display_refresh_rates to list what the headset supports. Both only work after the interface has initialized and only when the XR runtime supports the refresh rate extension. The refresh_rate_changed signal reports runtime-side changes.
- Does Godot support hand tracking?
- Yes. Godot implements OpenXR hand tracking on a standard humanoid skeleton and the same scene setup also works with WebXR. You enable hand tracking in project settings and, on devices like Quest, in the export settings, then add a tracked XRNode3D, a rigged hand mesh and a skeleton modifier per hand.
- Is Godot a serious option for XR compared to Unity and Unreal?
- For OpenXR targets it is. Godot 4.7 added production-ready support for Android XR and Steam Frame at launch, and the engine is MIT licensed with no royalties. The gaps are tooling maturity and vendor SDK depth, not the core rendering or tracking path.
Related reading
XR Game Engines Compared: Unity, Unreal, and Godot
Unity, Unreal, and Godot all target OpenXR, but they differ on visionOS support, licensing, renderer headroom, and iteration speed. How to choose for XR.
What Is OpenXR? The Cross-Platform XR API Explained
OpenXR is Khronos's open API between XR apps and headset runtimes. How the loader, extensions and action system work, and what the standard still leaves out.
XR Daily: An Open Headset With Two Brains
Vector Gear's dual-chipset open headset, Owlchemy's XREAL Aura lineup, Alibaba's eye-tracking glasses, and Bluey's 2D rendering trick.