Jump to content

Porting the "The Escape Room" to OpenXR in Unity


dario

Recommended Posts

Let's step through an existing complete working Unity application and port it to OpenXR using the OpenXR Unity XR plugin (now out of preview v1.0.3).  This has been tested on two runtimes, the SteamVR OpenXR runtime as well as the Vive OpenXR rumtime (for Cosmos). 

For this port let's try to find a canonical beginner complete working project. Like this one from Unity: 
 VR Beginner: The Escape Room 

screenshotIDEOPENXR.thumb.PNG.29c2a45aa2f1ee1d70875a6fc64f0955.PNG

The main scene is found in Assets/VR Beginner/Scenes/Final/EscapeRoom

This sample uses Unity's XR Interaction Toolkit - but instead of targeting devices in the XR Management Settings we'll be selecting OpenXR (install from Unity Registry in Package Manager)  After you install  it you may see a yelloe warning as shown above - open it and select to fix all issues.  Likely you need to select Features to use controllers in OpenXR.

OpenXR-Features.thumb.PNG.a3c0ab340221a7e0c776b03a1c67d379.PNG

Under Project Settings -> XR Plug-in Management Settings -,> OpenXR->Features

Now you should always support as many feature as possible - this include the Vive Cosmos support which you need to install as a package in package manager from a tar zip file - found in a pinned post in this forum - or below:
 

 

 

 

Now to make sure you're in sync with my package versions (working build) see below:

Note XR Interaction version (this project hasn't been updated to later versions)

 

openxr-packages.thumb.PNG.02d99ebd490979921e1b0ab0edd264f6.PNG

 

At this point, give it a try - it should work in editor and as a build.

 

escaperoom.PNG.f639b2f154cc5f6ece2514063ad408ea.PNG

 

Stay tuned for more on input and how to port over other apps using other toolkits (other than XR Interaction).

For the most part any tolkit using the Unit XR plugin framework (XR Management) should be able to work or will soon support it explicitly (e.g. VIU toolkit). thus depending on the app, in this case nothing additional was needed to be modified.  As long as you move to Unity XR plugin  (default now) you should be able to use the OpenXR plugin with the latest LTS (long term support) version of Unity: 2020.3.x   "Porting" made easy.

If you run into any issues feel free to respond here.

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...