VR/MR — LeonardoXR SDK

VR/MR — LeonardoXR SDK

VR/MR — LeonardoXR SDK

Version: 1.0.2
Target Device: Youbiquo Leonardo XR
Base SDK: Snapdragon Spaces 1.0.4


Manual Unity Project Configuration

It is recommended to use the Configuration Tool for the initial project setup (see Getting Started). This guide describes the equivalent manual steps for users who prefer direct control over the settings.

Edit Project Settings

  1. Go to Edit > Project Settings > XR Plug-in Management and open the Android tab.
  2. Enable the OpenXR plug-in and the Snapdragon Spaces feature group.
  3. Click the red exclamation mark next to OpenXR to open the OpenXR Project Validation window.
  4. Click Fix next to each item.
  5. Apply the “Enable both Input Systems” setting last, as it requires restarting the editor.

Play In Editor: For additional settings regarding the editor workflow, see the dedicated section in Getting Started.

Enable Spaces Features

Enable the features that must be active at runtime in OpenXR Settings. Each feature corresponds to an AR Foundation Manager and an XR Subsystem:

Feature AR Foundation Manager XR Subsystem
Base Runtime AR Session XRSessionSubsystem
Camera Frame Access AR Camera Manager XRCameraSubsystem
Hit Testing AR Raycast Manager XRRaycastSubsystem
Image Tracking AR Tracked Image Manager XRImageTrackingSubsystem
Plane Detection AR Plane Manager XRPlaneSubsystem
Spatial Anchors AR Anchor Manager XRAnchorSubsystem
Spatial Meshing AR Mesh Manager XRMeshSubsystem

Add Feature Usage Data to the Android Manifest

Navigate to Edit > Project Settings > Snapdragon Spaces Launcher Settings to declare the features required or supported by your application, including: Hand Tracking, Eye Tracking, Passthrough, Controllers, and Room Scale.

Warning: By default, all uses-feature values are set to true. Set to false any features not used by the application to avoid incorrect feature declarations in the manifest.

Import Samples

  1. Open Window > Package Manager and select the Snapdragon Spaces package.
  2. Click Import on Core Samples.
  3. Add all scenes to the build via Window > XR > Snapdragon Spaces > Add Scenes to Build Settings.

Important: The Camera Frame Access sample requires unsafe code mode to be enabled in Player Settings > Android > Other Settings > Script Compilation > Allow ‘unsafe’ Code.


Passthrough Setup

Passthrough allows you to view the physical environment as an image overlay on VR headsets. It is available on LeonardoXR for compatible devices.

  • It is activated via the Extend Content panel in the in-app UI (visible only on devices with Passthrough support).
  • It can also be toggled using the X and A buttons on the controller.
  • The enabling function is OnPassthroughToggle() in MainMenuSampleController, which sets PassthroughToggle on BaseRuntimeFeature.

WARNING: The session camera must have the Alpha channel of the Background set to 0 to use Passthrough correctly. An automatic warning will be logged if the settings are incorrect.

The delegate OnSpacesAppSpaceChange in BaseRuntimeFeature notifies when the device performs a recenter (triggered by holding down the menu button for 2 seconds on the VRX).


Scene Setup

Note: This guide assumes prior knowledge of AR Foundation and OpenXR. Refer to the official AR Foundation and OpenXR documentation for basic concepts.

Minimum Scene Hierarchy

To enable positional head tracking on LeonardoXR, the following objects are required:

AR Session
XR Origin
  └── Camera Offset
        └── Main Camera (tagged as "MainCamera")

Create them by right-clicking in the Hierarchy window and selecting XR > AR Session or XR > XR Origin.

Warning: Disable the AR Camera Manager component if you are not retrieving RGB frames from the camera, to avoid lifecycle issues.
Important: Disable the AR Camera Background component — it is not supported and will be automatically disabled at runtime.


Application Lifecycle — Compatibility with Older Runtimes

The Older Runtime Compatibility library prevents the application from launching when the SDK is not compatible with the OpenXR runtime installed on the device.

Upon launch, two entries are added to the Android manifest:

  • targetAPI — corresponds to the version of the OpenXR runtime included in the SDK.
  • minAPI — the minimum runtime version supported by each feature.

Version: Starting with Snapdragon Spaces 1.0.4, the minAPI for all features is 0.22.0.

Compatibility Results

Result Description
Success No incompatibility detected.
Error Runtime Failure OpenXR runtime error.
Error Validation Failure Older Runtime Compatibility validation error.
Error Uninitialized System Error due to missing initialization.
Error Runtime Too Old For Application The installed runtime is too old for the SDK.
Error Application Too Old For Runtime The SDK is too old for the installed runtime.

When an incompatibility is detected, a popup appears with an error message and a Quit button. For apps using Dual Render Fusion, the user is notified, but the application can still launch.


Known Issues — VR/MR on LeonardoXR

For issues not listed here, refer to the general known issues of the Snapdragon Spaces platform.

Gradle Build Issue

Adding a custom controller archive may cause Gradle caching errors. Deleting the Temp > gradleOut folder generally resolves the issue.

AR Foundation Issues

  • Incorrect Trackable ID returned by AR Raycast Hit — ARRaycastHit.trackableId always returns 0-0.
  • Plane Detection Frozen — Mesh triangulation enters an infinite loop in AR Foundation 6.2.1.

XRIT Issues

  • AR Raycast Manager Automatically Added — XRIT 3.x automatically adds an AR Raycast Manager when an XR Raycast Interactor is present, enabling Spatial Meshing regardless of the EnableARRaycasting flag. This may reduce performance.
  • Unsupported AR Mesh Manager Properties — Using unsupported properties generates runtime warnings.
  • AR Camera Manager / AR Camera Background Issues — Switching between scenes with the AR Camera Manager enabled may cause freezing. Disable AR Camera Background to avoid rendering issues.

Play In Editor Known Issues

  • Memory Leak in Camera Access Simulation — Resolved in AR Foundation 6.0+.
  • AR Mesh Manager Crash Without Normals — Update AR Foundation or enable normals.
  • QR Code Tracking Not Loaded in Simulation — No simulation subsystem exists; bypass checks in editor builds.
  • ScriptableSingleton Warning — Resolved in AR Foundation 5.1.2+.