title | description | author | ms.author | ms.date | ms.topic | keywords |
---|---|---|---|---|---|---|
OpenXR |
Build an engine using the portable OpenXR API standard and deploy it to Windows Mixed Reality and HoloLens 2 headsets. |
thetuvix |
vinnietieto |
10/14/2021 |
article |
OpenXR, roadmap, extensions, Khronos, BasicXRApp, DirectX, native, native app, custom engine, middleware |
OpenXR is an open royalty-free API standard from Khronos, providing engines with native access to a range of devices across the mixed reality spectrum.
You can develop using OpenXR on a HoloLens 2 or Windows Mixed Reality immersive VR headset on the desktop. If you don't have access to a headset, you can use the HoloLens 2 Emulator or the Windows Mixed Reality Simulator instead.
With OpenXR, you can build engines that target both holographic devices, like HoloLens 2, and immersive VR devices, like Windows Mixed Reality headsets for desktop PCs. OpenXR lets you write code once that's then portable across a wide range of hardware platforms.
The OpenXR API uses a loader to connect your application directly to your headset's native platform support. End users get maximum performance and minimum latency, whether they're using a Windows Mixed Reality or any other headset.
The OpenXR API provides the core pose prediction, frame timing, and spatial input functionality you'll need to build an engine that can target both holographic and immersive devices.
To learn about the OpenXR API, check out the OpenXR 1.0 specification, API reference, and quick reference guide. For more information, see the Khronos OpenXR page.
To target the full feature set of HoloLens 2, you'll also use cross-vendor and vendor-specific OpenXR extensions that enable additional features beyond the OpenXR 1.0 core, such as articulated hand tracking, eye tracking, spatial mapping, and spatial anchors. For more information, see the Roadmap section below on the extensions coming later this year.
OpenXR isn't itself a mixed reality engine. Instead, OpenXR enables engines like Unity and Unreal to write portable code once that can then access the native platform features of the user's holographic or immersive device, whatever vendor built that platform.
The OpenXR specification defines an extension mechanism that enables runtime implementers to expose additional functionality beyond the core features defined in the base OpenXR 1.0 specification.
There are three kinds of OpenXR extensions:
- Vendor extensions (for example,
XR_MSFT_...
): Enables per-vendor innovation in hardware or software features. Any runtime vendor can introduce and ship a vendor extension at any time.- Experimental vendor extensions (for example,
XR_MSFTX_...
): Experimental vendor extensions being previewed to gather feedback.XR_MSFTX_...
extensions are for developer devices only and will be removed when the real extension ships. To experiment with them, you can enable preview extensions on your developer device.
- Experimental vendor extensions (for example,
- Cross-vendor
EXT
extensions: Cross-vendor extensions that multiple companies define and implement. Groups of interested companies can introduce EXT extensions at any time. - Official
KHR
extensions: Official Khronos extensions ratified as part of a core spec release. KHR extensions are covered by the same license as the core spec itself.
The Windows Mixed Reality OpenXR Runtime supports a set of MSFT
and EXT
extensions that brings the full set of HoloLens 2 features to OpenXR applications:
While some of these extensions may start out as vendor-specific MSFT
extensions, Microsoft and other OpenXR runtime vendors are working together to design cross-vendor EXT
or KHR
extensions for many of these feature areas. Cross-vendor extensions will make the code you write for those features portable across runtime vendors, as with the core specification.
Minecraft's new RenderDragon engine has built its desktop VR support using OpenXR!
Microsoft has been working with Unity and Epic Games to ensure the future of mixed reality is open, not just for HoloLens 2, but across the full breadth of PC VR, including HP’s new Reverb G2 headset. OpenXR powers the cross-vendor VR support for major titles shipping today, such as Minecraft and Microsoft Flight Simulator! For more information on developing for HoloLens (1st gen), see the release notes.
To learn how you can get started with OpenXR in Unity, Unreal Engine or your own engine, read on!
Microsoft’s current recommended Unity configuration for HoloLens 2 and Windows Mixed Reality development is Unity 2020.3 LTS with the Mixed Reality OpenXR plugin. This plugin includes support for the OpenXR extensions that light up the full capabilities of HoloLens 2 and Windows Mixed Reality headsets, including hand/eye tracking, spatial anchors and HP Reverb G2 controllers. MRTK-Unity supports OpenXR as of MRTK 2.7. For more information about getting started with Unity 2020 and OpenXR, see Choosing a Unity version and XR plugin.
If you are developing for HoloLens (1st gen), you'll need to continue using Unity 2019.4 LTS with the legacy WinRT API backend. If you’re targeting the new HP Reverb G2 controller in a Unity 2019 app, see our HP Reverb G2 input docs.
Starting in Unity 2021.3 LTS, OpenXR will be the only supported Unity backend for targeting HoloLens 2 and Windows Mixed Reality headsets.
Unreal Engine 4.23 was the first major game engine release to ship preview support for OpenXR 1.0! Now in Unreal Engine 4.26, support for HoloLens 2, Windows Mixed Reality and other desktop VR headsets is available through Unreal Engine's built-in OpenXR support. Unreal Engine 4.26 also supports Microsoft's OpenXR extension plugin, enabling hand interaction and HP Reverb G2 controller support, lighting up the full feature set of HoloLens 2 and Windows Mixed Reality headsets. Unreal Engine 4.26 is available today on the Epic Games Launcher, with MRTK-Unreal 0.12 supporting OpenXR projects.
You can develop using OpenXR on a HoloLens 2 or Windows Mixed Reality immersive VR headset on the desktop. If you don't have access to a headset, you can use the HoloLens 2 Emulator or the Windows Mixed Reality Simulator instead.
To start developing OpenXR applications for HoloLens 2 or Windows Mixed Reality VR headsets, see how to get started with OpenXR development.
For a tour through all the major components of the OpenXR API, along with examples of the real-world applications using OpenXR today, check out this 60-minute walkthrough video: