A test project that exercises the alpha-native transparent overlay mode
of the DisplayXR Unity plugin
(added in #57; the
chroma-color workaround was removed in v1.6.0 — see
#103).
The Mixamo tiger (with a cube fallback) renders above the desktop with no
rectangular background — Unity emits per-pixel alpha into the OpenXR
swapchain via XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND and the runtime DP
composes the captured desktop under each tile pre-weave so anti-aliased
silhouettes carry true soft alpha. Clicks outside the silhouette fall
through to whatever desktop window is behind.
Render pipeline: Built-in (BiRP).
Sibling test projects — each repo focuses on one feature so a regression in one demo doesn't mask the others:
| Repo | What it demonstrates | Pipeline |
|---|---|---|
| displayxr-unity-test | Display-centric vs camera-centric rigs, live rig switching | BiRP |
| displayxr-unity-test-2d-ui | XrCompositionLayerWindowSpaceEXT 2D UI overlay (DisplayXRWindowSpaceUI) |
URP |
| displayxr-unity-test-transparent (you are here) | Alpha-native transparent overlay (DisplayXRTransparentOverlay) |
BiRP |
Assets/TransparentAutoSetup.csruns at scene load, attachesDisplayXRTransparentOverlayto the rig cameras, and wires the tiger (or cube fallback) as the click-through hit region. No edits toCubeTest.unityneeded.
- Unity 6000.3 LTS (Unity 6) or newer
- A Leia SR Windows machine (or recent Mac) for end-to-end verification — the native window restyling path doesn't run in the editor preview, only in a standalone build
- The DisplayXR runtime installed (via the
installer)
— must be a build that advertises
XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLENDon the D3D11/D3D12 service compositor and has the compose-under-bg + alpha-gate DP path. Plugin v1.6.0+ requires this.
The project depends on the DisplayXR Unity plugin via Unity Package Manager.
The dependency is declared in Packages/manifest.json and tracks the
latest released plugin version (the upm branch is force-pushed by the
plugin's CI on every v* tag, with the prebuilt native binary):
"com.displayxr.unity": "https://github.com/DisplayXR/displayxr-unity.git#upm"After editing, run Window → Package Manager → Refresh.
To test against a local development build of the plugin, change the dependency to:
"com.displayxr.unity": "file:/absolute/path/to/displayxr-unity"and delete the com.displayxr.unity entry from
Packages/packages-lock.json so Unity re-resolves on next open. Revert
before committing.
- Open the project in Unity Hub. First import takes a few minutes.
- Open
Assets/CubeTest.unity. - Build a standalone (
File → Build Settings → Build, targetBuilds/Win64/DisplayXR-test/). Editor Play Mode shows the scene cleared to transparent but does not apply the native window restyling — that's a build-only path. - Run the resulting
.exe(or.app) on a Leia SR machine.
End-users typically don't build from source. The latest release ships a Windows installer (DisplayXR-Unity-TestTransparent-Setup-X.Y.Z.exe) that:
- Hard-prereqs the DisplayXR runtime (requires v1.7.0+ for the alpha-native path; aborts gracefully if older or missing).
- Installs the Player to
C:\Program Files\DisplayXR\Unity\TestTransparent\. - Registers the app with the DisplayXR Shell launcher (drops a
.displayxr.jsonmanifest + icons under%ProgramData%\DisplayXR\apps\) so it appears as a tile.
After installing, launch via the DisplayXR Shell tile or directly from the install dir.
Requires NSIS installed at C:\Program Files (x86)\NSIS\.
- Build the Unity Player (step 3 above) — output must land at
Builds/Win64/DisplayXR-test/. - From a Developer Command Prompt:
cd installer && build-installer.bat. - Output:
installer/DisplayXR-Unity-TestTransparent-Setup-X.Y.Z.exe. Override the version withset VERSION=1.x.ybefore invoking.
- Tiger / cube renders above the desktop with no rectangular background.
- Anti-aliased silhouette edges blend cleanly into the desktop — no chroma fringe, no hard-mask jaggies.
- Clicks on the transparent region fall through to the underlying app (e.g. Notepad activates and accepts text).
- Clicks on the tiger reach Unity (console logs the
onPointerClickpayload). - Tiger / cube pops convincingly in stereo. Transparent regions stay clean (no shimmer).
- Player.log shows
[DisplayXR] EnvironmentBlendMode = AlphaBlend (transparent session)and noXR_ERROR_VALIDATION_FAILURE/"is not supported for current Runtime".
| Plugin version | Runtime version | Mechanism |
|---|---|---|
| v1.2.x – v1.5.13 | runtime ≥ v25.6.x | Chroma-key (camera paints a marker color, runtime DP converts to alpha=0 post-weave). Removed in v1.6.0. |
| v1.6.0+ (current) | runtime advertising ALPHA_BLEND + compose-under-bg + alpha-gate DP path |
Alpha-native end-to-end. Same path on Windows and macOS. |
A plugin / runtime version mismatch where the plugin is v1.6.0+ but the
runtime doesn't advertise ALPHA_BLEND fails the same way as the
v1.5.6 → v1.5.12 regression: every xrEndFrame returns
XR_ERROR_VALIDATION_FAILURE and Unity content never reaches the
swapchain. Cross-check Player.log when in doubt.
The transparent overlay's click-through is wired through a single
clickableRenderers array in Assets/TransparentAutoSetup.cs, and
the asset is identified by name (k_TargetName) — so swapping in a
different model is mostly a one-line change. See
docs~/swap-asset.md for the full procedure,
import-settings checklist, multi-renderer extension, and a
troubleshooting section keyed to the specific symptoms users hit
historically.
Comment out the body of TransparentAutoSetup.Install() and rebuild — the
scene falls back to the default skybox.
For plugin bugs, file issues on the DisplayXR Unity plugin repo.
ISC. See LICENSE.