Getting started with OpenXR - Mixed Reality (2024)

  • Article

You can develop using OpenXR on a HoloLens 2 or Windows Mixed Reality immersive 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.

Getting started with OpenXR for HoloLens 2

To start developing OpenXR applications for HoloLens 2:

  1. Set up a HoloLens 2 device or install a recent version of the HoloLens 2 emulator.

That's it! The OpenXR API runtime is preinstalled on HoloLens 2 devices, and you'll receive automatic updates through the Store.

To make sure you've got the latest OpenXR runtime with all extensions present, you can launch the Store app from the HoloLens device or emulator. Open the menu in the upper-right of the Store app, select Downloads and updates, and choose Get updates.

Note

If you're using the emulator, the emulator image will reset each time you start it, and so your best bet is to just make sure that you have the latest version of the HoloLens 2 emulator image.

Getting started with OpenXR for Windows Mixed Reality headsets

To start developing OpenXR applications for immersive Windows Mixed Reality headsets:

  1. Be sure you're running at least the Windows 10 October 2020 Update (20H2), which is the minimum supported OS release for Windows Mixed Reality end users to run OpenXR applications. Earlier versions of Windows 10 should still work with OpenXR but may not have ideal performance or quality. If you're on an earlier version of Windows 10, you can upgrade by using the Windows 10 Update Assistant.
  2. Set up a Windows Mixed Reality headset or enable the Windows Mixed Reality simulator.

That's it! The Windows Mixed Reality OpenXR runtime is installed and made active automatically for all Windows Mixed Reality users. The Microsoft Store then keeps the runtime up to date.

If you've been using multiple VR headsets on your PC, keep in mind that the active OpenXR runtime may be changed by another vendor's system software. To reactivate the Windows Mixed Reality OpenXR Runtime, on the Start menu, launch "Mixed Reality Portal" and then select "Fix it" at the top of the window. If that button is missing, the OpenXR runtime is already active.

If you're developing OpenXR applications for HoloLens 2 or PC VR, you might find this OpenXR Tools for Windows Mixed Reality app useful. It provides a demo of various OpenXR features and an OpenXR Runtime page that contains key information about the active runtime and current headset.

To find and install the OpenXR Tools app, on your HoloLens 2, go to the Store app and search for "OpenXR."

When using the HoloLens 2 emulator, the easiest way to install the OpenXR Tools for Windows Mixed Reality is through the Windows Device Portal. In the Portal, navigate to the "OpenXR" page and then, under Developer Features, select the Install button. This also works on physical HoloLens 2 devices.

Getting started with OpenXR - Mixed Reality (1)

Exploring the OpenXR API and sample app

Be sure to install the tools you'll need for OpenXR development if you haven't already.

The BasicXrApp project shows a simple OpenXR sample with Win32 and UWP HoloLens 2 project files in Visual Studio. Because the solution contains a HoloLens UWP project, you'll need the Universal Windows Platform development workload installed in Visual Studio to fully open it.

While the Win32 and UWP project files are separate because of differences in packaging and deployment, the app code inside each project is almost exactly the same!

For a tour of the OpenXR API, check out this 60-minute video of the BasicXrApp sample in Visual Studio. The video shows how each of the major components of the OpenXR API can be used in your own engine, and also demonstrates some of the applications built on OpenXR today:

Running your OpenXR app

After building an OpenXR Win32 desktop .EXE, you can use it with a VR headset on any desktop VR platform that supports OpenXR, whatever the headset type.

After building an OpenXR UWP app package, you can deploy that package to either a HoloLens 2 device or the HoloLens 2 Emulator.

Using OpenXR in an existing project

To get started with OpenXR in an existing project, you'll include the OpenXR loader. The loader discovers the active OpenXR runtime on the device and provides access to the core functions and extension functions that it implements.

You can reference the official OpenXR NuGet package from your Visual Studio project or include the official OpenXR loader source from the Khronos GitHub repo. Either approach will give you access to OpenXR 1.0 core features, plus published KHR, EXT and MSFT extensions.

If you're interested to experiment with MSFT_preview extensions as well, you can copy in preview OpenXR headers from the Mixed Reality GitHub repo.

Reference official OpenXR NuGet package

The OpenXR.Loader NuGet package is the easiest way to reference a prebuilt OpenXR loader .DLL in your Visual Studio C++ solution. This will give you access to OpenXR 1.0 core features, plus published KHR, EXT and MSFT extensions.

To add an OpenXR.Loader NuGet package reference to your Visual Studio C++ solution:

  1. In Solution Explorer, right-click the project that will use OpenXR and select Manage NuGet Packages....
  2. Switch to the Browse tab and search for OpenXR.Loader.
  3. Select the OpenXR.Loader package and select Install in the details pane to the right.
  4. Select OK to accept the changes to your project.
  5. Add #include <openxr/openxr.h> to a source file to start using the OpenXR API.

To see an example of the OpenXR API in action, check out the BasicXrApp sample app.

Include official OpenXR loader source

If you want to build the loader yourself, for example to avoid the extra loader .DLL, you can pull the official Khronos OpenXR loader sources into your project. This will give you access to OpenXR 1.0 core features, plus published KHR, EXT and MSFT extensions.

To get started here, follow the instructions in the Khronos OpenXR-SDK repo on GitHub. The project is set up to build with CMake - if you're using MSBuild, you'll need to copy the code into your own project.

Using preview extensions

The MSFT_preview extensions listed in the extension roadmap are experimental vendor extensions being previewed to gather feedback. These extensions are for developer devices only and will be removed when the real extension ships.

If you're interested to try out the available MSFT_preview extensions, go through the following steps to update your project:

  1. Follow either of the approaches above to integrate an OpenXR loader into your project.
  2. Replace the standard OpenXR headers in your project with the preview headers from the Mixed Reality OpenXR repo on GitHub.

To then activate preview extension support on your target HoloLens 2 or desktop PC:

  1. To make sure you've got the latest OpenXR runtime with all extensions present, launch the Store app from within the target device or emulator, open the menu in the upper-right, select Downloads and updates and choose Get updates.
  2. Install the OpenXR Tools for Windows Mixed Reality app from the Microsoft Store onto the target device and run it.
  3. Navigate to the Settings tab and enable Use latest preview OpenXR runtime. This enables the preview runtime on your device, which has preview extensions activated.Getting started with OpenXR - Mixed Reality (2)
  4. Confirm the Runtime version shown on the OpenXR Runtime tab of the OpenXR Tools for Windows Mixed Reality matches the required version of the preview extensions you plan to try. If so, you should see the extension in the Extensions list. Once a stable extension is available, its preview extension will be removed.
    Getting started with OpenXR - Mixed Reality (3)

See the Mixed Reality OpenXR repo for documentation of these preview extensions and samples of how to use them.

Troubleshooting

If you have trouble getting up and running with OpenXR development, check out our troubleshooting tips.

Getting started with OpenXR - Mixed Reality (2024)

FAQs

Getting started with OpenXR - Mixed Reality? ›

Key Differences Between OpenXR and Windows Mixed Reality

OpenXR provides high-performance, royalty-free access to AR/VR, while Windows Mixed Reality operates mainly in VR space. Windows Mixed Reality aims at mass-market entry with compatibility with standard laptops and PCs, OpenXR focuses on extensive hardware reach.

What is the difference between OpenXR and mixed reality? ›

Key Differences Between OpenXR and Windows Mixed Reality

OpenXR provides high-performance, royalty-free access to AR/VR, while Windows Mixed Reality operates mainly in VR space. Windows Mixed Reality aims at mass-market entry with compatibility with standard laptops and PCs, OpenXR focuses on extensive hardware reach.

How do I enable OpenXR in Windows Mixed Reality? ›

Install the OpenXR Tools for Windows Mixed Reality app from the Microsoft Store onto the target device and run it. Navigate to the Settings tab and enable Use latest preview OpenXR runtime. This enables the preview runtime on your device, which has preview extensions activated.

How do I use OpenXR? ›

  1. From your computer, open the SteamVR app.
  2. Head to Settings.
  3. Select Show in Advanced Settings.
  4. Head to the Developer tab.
  5. Set Current OpenXR runtime as "OpenXR runtime"
  6. Launch Microsoft Flight Simulator.
  7. Put your headset on.
Jan 27, 2024

Is OpenXR better than SteamVR? ›

There are a few reasons why OpenXR might offer better performance than SteamVR in DCS. First, OpenXR is a newer standard designed to be more efficient. Second, OpenXR can take advantage of specific hardware features and more customizations, which can help to improve performance.

Can Oculus use OpenXR? ›

Please enable OpenXR backend for Oculus Plugin through the 'Oculus -> Tools -> OpenXR' menu. Selecting Set OVRPlugin to OpenXR allows me to build the project, but the index finger no longer folds when pressing the index triggers for some reason.

Is mixed reality better than augmented reality? ›

Mixed Reality (MR) advances a step further than AR by combining the virtual and physical worlds in a way that enables virtual objects to interact with the real environment. In MR, users don't just see the digital content; they can manipulate and interact with it as if it's part of their surroundings.

How do I switch to OpenXR? ›

SteamVR
  1. Open SteamVR.
  2. Open the settings from the hamburger menu.
  3. Click Show 'Advanced Settings' at the bottom left corner.
  4. Select the Developer tab.
  5. Press 'Set SteamVR as OpenXR runtime'

Does Mixed Reality work on Windows 11? ›

In January 2023, Microsoft laid off entire teams which were developing HoloLens, Virtual Reality, and Mixed Reality products. On December 21, 2023, Microsoft announced that WMR has been deprecated and will be removed in Windows 11 version 24H2 expected in late-2024.

Why use OpenXR? ›

OpenXR is the new open standard for XR (VR/AR/MR) applications and boosts your experience, and for this release of VRED, works with VR devices, tethered or not. It also includes hand tracking to controller input simulation, so that devices using OpenXR can also use hand tracking directly in VRED.

Is the OpenXR toolkit safe? ›

Run the OpenXR-Toolkit.msi program.

The application is built on a GitHub server hosted in the Microsoft cloud, which greatly limits the risk of contamination from viruses and malware.

What is the OpenXR toolkit? ›

OpenXR Toolkit is a code injector, much like ReShade, which can be used to intercept frames coming from the game, and apply post effects to them, before the VR runtime gets them -- effects such as colour/level balancing, sharpening, and upscaling.

Can OpenXR run SteamVR games? ›

SteamVR has become almost synonymous with OpenVR as OpenVR is developed by Valve which many VR games use. SteamVR supports both the OpenVR and OpenXR runtime, but defaults to OpenVR unless the game only supports OpenXR.

What is the difference between OpenVR and OpenXR? ›

Key Differences Between OpenXR and OpenVR

OpenVR was released earlier in 2015, with OpenXR entering the scene in 2019. OpenXR has extensive extension support for advanced VR features, while OpenVR's feature updates revolve around gaming application enhancements.

What is the difference between OpenXR and WebXR? ›

WebXR focuses on enabling immersive experiences directly within internet browsers, catering to a broader audience of users. In contrast, OpenXR is specifically designed for creating VR, AR, and MR applications that are compatible across XR devices like mixed reality headsets and VR glasses.

Is XR the same as mixed reality? ›

Mixed Reality (MR): a view of the real world—physical world—with an overlay of digital elements where physical and digital elements can interact. Virtual reality (VR): a fully-immersive digital environment. Extended reality (XR): an umbrella term that covers all these different technologies, including AR, MR, and VR.

What does OpenXR do? ›

OpenXR is a royalty-free, open standard that provides a common set of APIs for developing XR applications that run across a wide range of AR and VR devices.

What is the difference between open VR and OpenXR? ›

Key Differences Between OpenXR and OpenVR

OpenVR was released earlier in 2015, with OpenXR entering the scene in 2019. OpenXR has extensive extension support for advanced VR features, while OpenVR's feature updates revolve around gaming application enhancements.

What is the difference between mixed reality and hologram? ›

Mixed reality (MR) experiences combine AR and VR elements, where real-world and digital objects interact. Holograms are projected into the physical world, which can be directly manipulated, similar to concepts explored in science fiction.

Top Articles
Latest Posts
Article information

Author: Otha Schamberger

Last Updated:

Views: 5895

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.