Unity support for OpenXR in preview

Unity’s new OpenXR plug-in enables you to target a broad range of AR/VR devices. As of today, it’s available as a Preview package for Unity 2020.2, and we’re inviting you to share your feedback.

What is OpenXR?
OpenXR is an open standard provided by Khronos that aims to simplify AR/VR development by allowing developers to seamlessly target a wide range of AR/VR devices. Unity is a proud member of the Khronos group and an active contributor to the OpenXR standard. We’re excited to share our progress with the OpenXR plug-in now in Preview.

Value to developers
Our mission is to make it as easy as possible for developers to take their content to the platforms they want. With Unity’s OpenXR plug-in, developers can target any conformant OpenXR device/runtime. As more vendors adopt OpenXR, developers will be able to reach a wider range of devices.

How OpenXR fits into Unity’s XR Tech Stack
Today, Unity delivers full support of AR/VR platforms and their native APIs via the existing plug-ins in XR Plug-in Management. In the same fashion, the OpenXR plug-in is implemented as a part of our XR plug-in framework (XR SDK). This means that developers can continue using Unity’s suite of XR workflows and frameworks (AR Foundation, XR Interaction Toolkit, Unity MARS) for platforms that adopt OpenXR, as well as for any platforms that may choose not to adopt it.

Getting Started
To enable OpenXR in your project, follow the steps below:

  • Install the OpenXR Plugin package from Package Manager (use the Advanced drop-down to enable preview packages).
  • Open the Project Settings window (menu: Edit > Project Settings), and select XR Plug-in Management.
  • Enable the OpenXR option and any Feature Sets for the platforms you intend to target.
  • In the OpenXR Features tab, select the interaction profile of the device you are testing with.
  • In the OpenXR tab, make sure the current active runtime is set to the hardware you are testing with.

More information can be found in our documentation. These should be familiar workflows that are similar to enabling other AR/VR platforms in your projects.

OpenXR Features
Developers can select feature sets for supported platforms, which enable the set of OpenXR features needed for that platform. Note that if you’re developing for HoloLens 2, you will need to download Microsoft’s new OpenXR features package. Additional configuration of OpenXR features can be made in the OpenXR Features window.

Unity Input System
Because OpenXR only supports action-based input, Unity’s OpenXR plug-in makes exclusive use of our Input System for input and interactions. Make sure you have a good understanding of the Input System, including action-based input and device layout bindings. You can import our OpenXR controller sample in the OpenXR plug-in package via Package Manager, or reference this documentation and webinar to learn more about the Input System.

OpenXR Interaction Profiles
Interaction Profiles are controller layouts that users can bind to their actions in Unity’s Input System. For example, the Windows Mixed Reality feature set includes the Microsoft Motion Controller Profile to support Windows Mixed Reality controllers. At least one Interaction Profile must be selected in the OpenXR tab. Several interaction profiles are included with Unity’s OpenXR plug-in, and more can be added via the Features tab.

XR Interaction Toolkit
Developers can use the XR Interaction Toolkit with the OpenXR plug-in. If your project is using a platform-specific toolkit (e.g. MRTK, Oculus Integration), we don’t recommend enabling OpenXR yet, since many vendors are still in the process of adding support for OpenXR. Please refer to the vendors directly on the latest status of their toolkits and integration with OpenXR.

Supported platforms
Unity’s OpenXR plug-in should work with any device that supports conformant PC-based OpenXR runtimes. For this Preview release, Windows Mixed Reality and HoloLens 2 have been fully tested and are officially supported. See here for currently supported features specific to HoloLens 2.

Deploying directly to Oculus Quest/Quest 2 is not yet supported, but is on our roadmap. We plan to expand the number of supported platforms in the future as more of our platform partners adopt the OpenXR standard. However, given the unbounded combinations of possible hardware/software configurations, Unity is unable to test or guarantee that all configurations will work optimally. To help the community as a whole, Unity will continue to submit any runtime issues, and contribute conformance tests and specification changes to the Khronos working group.

How you can help
While you are welcome to use OpenXR in your projects, please note that the OpenXR plug-in is in Preview and should be considered a work in progress until it’s verified. During the preview period, we are looking for feedback from a broader range of customers to ensure that the feature set, workflows, performance and stability meet your needs.

If you post OpenXR-related questions outside of this thread, please make sure to use the right tags so our team and platform partners have proper visibility. For example, if you’re using OpenXR for HoloLens 2, include the tags “OpenXR” and “HoloLens”.

Known issues

  • Deploying directly to Oculus Quest/Quest 2 will be released at a later date.

  • A black box appears in the upper-right quadrant when running in Oculus desktop. We will release an updated Oculus runtime to fix this, but in the meantime, you can turn off occlusion mesh for the built-in renderer.

  • Eye Tracking Interaction device layout does not appear in the Unity Input System menus.

  • Importing “Meshing Subsystem Feature Sample” will show an error message in the console. Please restart the editor after import to correct the issue.

  • See here for known issues specific to Windows Mixed Reality and HoloLens 2.

If you experience an issue, please file a bug report. When you do, please also check the log file, where it will indicate whether Unity supports the combination of OpenXR runtimes and features that you are using. Additional guidance will be provided in the log file.

We’re excited about the progress made so far, and development continues. Please send us feedback via this quick survey, or post a question in this thread.

17 Likes

My first and only question so far is about the current compatibility with Valve Index and HTC Vive, as you only mentioned WMR and HoloLens 2 as officially supported.

6 Likes

Is this coming for 2019.4.x soon also?

It works with the beta SteamVR runtime and we’re working with Valve to ensure compatibility. Their goal is to transition everyone to OpenXR when it’s at feature parity.

5 Likes

We don’t plan on bringing it back to 2019.4 since it’s a new feature. But unofficially: it does work with 2019.4… can’t guarantee that will be the case going forward.

3 Likes

We welcome any feedback you have on compatibility problems or other issues when using other OpenXR runtimes on Windows.

1 Like

Does this support Hardware tracker devices such as Vive trackers?

2 Likes

That’s a real bummer. What’s going to happen to everyone who’s using 2019 LTS? We never really had a real solution for this, are we all at the mercy of SteamVR plugin?

Is 2020 stable enough to be used in production?

This is a pre-release, which means it should not be used for production. We are looking for feedback from all of you to help find any issues we did not discover during our development to help us bring this to production quality. We intend to bring this to production quality over the next months.

Yes, I understand that the XR plug-in is pre-release and that’s fine and totally expected. Maybe I wasn’t clear but I was referring to the Unity versions 2019 and 2020, and after this plugin is out of preview. You (rather your colleague) said the plugin works in 2019 but “can’t guarantee that will be the case going forward”.

What is the plan, going forward, for 2019.4 LTS as far as XR (and Valve devices) goes, Is upgrading to 2020 the only option we have?

Considering everything, by the time OpenXR gets out of preview we should already have 2020 LTS in place

:smile: That’s why I am wondering if 2020 is stable enough for me to upgrade. So far VR stuff has been unpleasant to say the least. I was very excited about this new plugin but alas! I am on 2019 LTS. I’d rather deal with few bugs here and there with 2020 than having to deal with what we have now for VR.

Just so I understand this: What prevents us from using 2019.4 at this point? If I’m not mistaken, the SteamVR plugin is using the OpenXR interface for rendering rather than the legacy system since version 2.6.1 (August 2020 I think).

I don’t think the SteamVR plugin uses OpenXR - the SteamVR OpenXR runtime isn’t out of developer preview yet.

Just to be clear - this is a preview. Lot of moving parts in the tech stack but we think it’s at a point where devs can start trying it and getting feedback to us and the runtime vendors. We don’t expect anyone to actually ship an app via OpenXR until we get out of preview. The package does work on 19.4 and you can try it there, but we’re not officially targeting or supporting it right now. If there’s enough developers wanting 19.4 when we come out of preview we will consider releasing it there too. But 2020.2 is our current target.

Maybe I’m also mixing up terms here: According to the project on github, Valve’s Unity XR plugin is embedded in the SteamVR plugin since 2.6.1, giving access to Unity’s XR plugin pipeline so we can use current rendering methods such as HDRP and URP, right?

Would a full transition to OpenXR then mean that we can use Unity directly rather than the SteamVR plugin to build our interaction systems? I’m still not quite clear on the differentiation here :slight_smile:

1 Like

Yes, everything you said is correct I believe. With the OpenXR plugin you’ll no longer need the SteamVR plugin to target the SteamVR runtime. OpenXR has a similar input model to SteamVR with actions - we’re hooking them up to the Unity input system with OpenXR and thus they’ll work across runtimes. The preview version makes actionmaps look like controllers, but we’re working on being able to pass your game’s actions directly down to OpenXR. More details on input model: https://docs.unity3d.com/Packages/com.unity.xr.openxr@0.1/manual/input.html

2 Likes

We will not be officially supporting OpenXR for 2019.LTS. We intend to bring OpenXR to a verified state for 2020.LTS.

3 Likes

Thanks for the clarification, very helpful! So in our case, we have a dev project starting early next year and if we’re lucky, we’ll reach the refactoring of the input model (which still relies on an older SteamVR plugin / input system) by the time 2020.LTS will be released in spring. So from a strategic point of view, it sounds like it may make sense to start developing on OpenXR rather than the SteamVR plugin, who knows how long Valve will maintain their own plugin when there’s a cross-platform standardized solution built into the engine…

I just upgraded my project to use this new openxr plugin and it worked first time, a far better experience than unity XR with the steam xr plugin ever was, thanks!

I’m using Index controllers with open XR, everything works out of the box except the XRRig which I think I took from the XR interaction toolkit sample originally has the controller models at the wrong position and angle, I’m not too sure why as using the old deprecated steam XR plugin they were in the correct position and angle.

Also does this new plugin support finger tracking yet for the Index controllers? If so is there an example sample anywhere using hand models?

1 Like

For this release, we have an input model, that we internally call v1, which closely makes controllers look like how they have typically been seen to Unity. We are working on v2 input, which will closely match the action map scheme of OpenXR to the new input system of Unity, though this is still several months out. We are putting in a lot of effort in around OpenXR as well is Valve and other partners, so if you are just starting a new project on 2020.2+, OpenXR may be the best choice. Remember though that this is still in the early days of the release, both for our implementation and the runtimes, so expect there to be issues. Please report the issues with repro steps in order to help us to be able to diagnose and correct them.

2 Likes