Set up Direct Preview for Godot Engine

Applicable XR devices
This guidance helps you build experiences for these types of XR devices.
XR Headsets
Wired XR Glasses

Direct Preview lets you test and iterate on complex interactions directly inside the Godot Editor using live data from the Android XR Device. With Direct Preview, the host machine renders and debugs the content, streams the visual viewport directly to your physical Android XR device, and streams supported OpenXR extensions back to the host in real time.

Follow this guide to set up Direct Preview for your project in Godot.

Prerequisites

Before beginning, ensure your development environment meets the following requirements:

  • Android XR Engine Hub: Complete all the steps in the get started section of the Android XR Engine Hub guide to install and configure your host machine for Direct Preview.
  • Hardware:

    • Use a host machine running Windows 11.
    • Use a modern graphics card with Vulkan Video Encoding support.

Configure your editor settings

Select the active OpenXR runtime specifically for the editor session:

  1. Open your project in Godot.
  2. Navigate to Editor Settings.
  3. Locate the XR section.
  4. In the OpenXR drop-down (or Runtimes list), select AndroidXR Streaming Runtime.

    Selecting the Android XR Streaming Runtime to enable
Direct Preview.

Start Direct Preview

Start Direct Preview to stream directly from Godot:

  1. Connect your Android XR device to your host machine using a high-quality USB-C cable.

  2. If you've never used this device with Direct Preview before, connect and configure the device for Direct Preview in the Android XR Engine Hub before you start Direct Preview through your game engine.

  3. In the Godot Editor, click Play or press F5.

    The Godot Game window on your host machine mirrors the view, and the headset displays the VR content.