documentation

HoloLens OpenXR Integration

Level: Basic

On HoloLens, it is also possible to use OpenXR as an XR Plugin. Beginning with Unity 2021, it will no longer be possible to use Windows MR and OpenXR will become mandatory. The steps for integrating OpenXR and VisionLib in a Unity project are described below. Consider reading the HoloLens Tutorial for more details regarding HoloLens applications with VisionLib.

Preparation

Please ensure you have set up your system for HoloLens Development with Unity as per the following requirements:

  • Windows 10, Windows 10 SDK, Developer Mode activated
  • HoloLens 2 with activated Developer Mode (OpenXR API is not supported for HoloLens (1st gen))
  • Visual Studio 2019 (with UWP Tools installed) or higher
  • Unity 2020.3 or higher with .NET/IL2CPP scripting backend

OpenXR

OpenXR on HoloLens is compatible with Unity 2020.3 or higher. This guide has been tested with OpenXR Plugin v1.4.3 and Unity 2020.3.

  1. In the build settings of your project, select UWP with HoloLens as target device and click Switch Platform.

VisionLib

  1. Import VisionLib.SDK-Unity.tgz as well as VisionLib.SDK.HoloLens-Unity.tgz via the package manager.
  2. Copy your license file to Assets/StreamingAssets/VisionLib.

OpenXR

  1. Download the Mixed Reality-Featuretool.
  2. Start MixedRealityFeatureTool.exe
    1. Wait for the tool to update itself, then press Start.
    2. Select the root folder of your Unity project as Project Path and click Discover Features.
    3. Select the Mixed Reality OpenXR Plugin under Platform Support and click GetFeatures.
    4. Click Import and then Approve to include the Mixed Reality Toolkit.
    5. Close the Microsoft Mixed Reality Feature Tool by pressing Exit.
  3. Open your Unity project.
    1. Select OpenXR as Plug-in Provider in XR Plug-in Management under ProjectSettings.
      1. Make sure Microsoft HoloLens feature group is selected.
    2. Click on the yellow exclamation mark to the right of the OpenXR checkbox. This opens the OpenXR Project Validation.
      1. Press the Fix All button to setup your project for the use with OpenXR
    3. Open the OpenXR subsection:
      1. Select Microsoft HoloLens
      2. Add the Microsoft Hand Interaction Profile as Interaction Profile.
  4. Add your scene to the build settings and follow the build instructions given in the HoloLens Model and Poster Tracker Tutorial