XR Plug-in Management - > select ‘OpenXR’ in windows and android tabs.
Under XR Plug-in Management ‘OpenXR’ Project Settings entry appears.
Interaction Profiles - > Select ‘Oculus Touch Controller Profile’
Play Mode OpenXR Runtime - > Select ‘Oculus’ (this gets it working in play mode in the editor, and you have to keep selecting this every time you re-open your project)
You also have to do Project Settings - > Package Manager - > Enable Pre-release Packages.
Right click and add an XRRig (device based) game object to the scene.
Make sure Oculus Quest 2 is set to Developer Mode.
You also need to do: Window - > Analysis - > Input Debugger. In the Input Debugger window you need to select ‘Lock Input To Game View’ in order for headsets to work in editor play mode as well.
Now here’s where things get tricky.
Under Project Settings - > Player…You have to have both ‘Direct3D11’ and ‘Linear’ color spaces to use the Oculus/OpenXR in edit mode.
However, the Oculus Quest 2 when building to Android needs ‘Gamma’ and ‘OpenGLES 3.0’.
This is creating a real problem, because now I need to build the game in Android, Gamma, and OpenGLES 3.0. Switching to Gamma and switching to OpenGLES 3.0 requires a huuuge re-import.
Is there a way I can just get the testing in editor play mode working using Gamma and OpenGLES instead? It just won’t work unless I select specifically Linear color space and Direct3D11 under API.
Editor with OpenXR should not require linear color space. If you have OpenXR enabled for stand alone and d3d11 set for the windows player then you should be able to have opengles / OculusXR for android. If for some reason you cant run with d3d11 / gamma please submit a bug report at Help -> Report a bug with a sample project that demonstrates this setup. Thank you
I’ll maybe create an unlisted youtube video as well to post here.
Is there a way I can get the crash report myself to check the code? Is it the code in the ‘OpenXR Plugin’ or the ‘XR Plugin Management’ folders under Packages?
EDIT: Sorry for this, but I don’t know how to properly report an issue, does that pop up when it crashes?
Okay, upon further testing, Gamma color space is working, but the Vulkan API is not working with Oculus Quest 2. Right now the Unity Bug Reporter is packing the report.
I’m going to test other graphics APIs and get back to you on which ones work and which don’t. I know that Direct3D11 does work with the Oculus Quest 2, but again this isn’t supported by Android.
Here’s the video and I’ve reported the bug as well but don’t know how to give you the number.
The problem is that Vulkan crashes when PlayMode OpenXR Runtime is set to - > Oculus and using the Oculus Quest 2 with the Oculus Link.
OpenGLES 3.0 won’t work also with Gamma, so that means the only Graphics API that working with the Oculus Quest 2 right now is Direct3D11 which won’t work with Android builds.
Here’s a Youtube showing as clearly as possible what’s happening:
(This is a 2 minute video explaining the problem as clearly as I can)
I’ve learned a TON of things in the last 5 days of trying to port to the Oculus Quest 2 natively.
Using the following settings I was able to solve the problem, and test in editor with the Oculus Quest 2 headset AND build to the platform.
The trick was to not select ‘OpenXR’ under XR Plug-in management, and to switch to Android build platform in the Unity Editor.
Enabling the incremental garbage collector for some reason was required for me to stop it from locking up when I tested in editor play mode.
I’m not entirely sure how SteamVR will work now since I can’t build an EXE, have XR Plug-in Management with ‘OpenXR’ selected, it NEEDS to be Oculus for PC builds too…but, my thought is that Steam Works just has branches or some way you upload different separate EXE files per the headset you’re targeting.
P.S - I haven’t tried Vulkan, but OpenGLES 3.0 is working.
For some reason it works when you hit ‘build and run’ for pc, but even if I try to boot up the runtime manually, when you select OpenXR and build to a windows executable and run it, it won’t launch the game even if you’re using Steam VR.
Steam VR only works for Oculus Quest 2 at my end if you selected Oculus as your PC runtime.
I need to do more testing. So far SteamVR recognizes the headset standalone only when I build it for PC - > Oculus.
For anyone else reading this, when you’ve got your Oculus Quest 2 hooked up, you need to switch to PC - > OpenXR and select Oculus Headset for playtesting with with the Oculus controllers profile…But THEN you can switch to Android or whatever you’d like and it’ll work properly. It’s very strange.
I am not sure I follow completely. When you say go to PC → OpenXR and select oculus what does that mean? Do you mean the play mode runtime in the openxr settings?
OpenXR is a utter mess…does anyone have any insights as to when we will be able to use and not spend weeks messing about with it like @astracat111 ? I am really disappointed in Unity and Oculus for this rather poor rollout of OpenXR. What a sh@t show.
What issues are you having? The experience of astracat11 has not been found to be the common experience of our users. There are already products released using Unity/OpenXR. If you have specific issues you have please let us know and we can try to help you through it.
@the_real_apoxol It states I need Unity 2019 or new to use OpenXR with Unity yet I am on 2021.1.15f1. Plus it does not support FFR yet which is pretty key feature for most titles. I already submitted a bug a few days ago and am waiting to hear back.
2021.1.15f1 supports OpenXR, are you having a problem getting it to work?
Yes FFR is not supported in OpenXR as it is not part of the OpenXR Specification. Oculus has just recently announced their plans to move forward with OpenXR but they do not have an extension yet for FFR. We will be working with Oculus as they develop their OpenXR extensions and I would image they will eventually have a FFR extension available. Please understand that OpenXR is an open standard and at unity we can only support what is in that standard. As the standard improves we will continue to support the newer features and in the mean time runtimes will continue to add their own functionality via extensions.