Search Unity

Official Unity support for OpenXR in preview

Discussion in 'AR/VR (XR) Discussion' started by rickmus, Dec 17, 2020.

Thread Status:
Not open for further replies.
  1. rickmus

    rickmus

    Unity Technologies

    Joined:
    Sep 10, 2017
    Posts:
    10
    Hey Everyone,

    We are catching up from post holidays and will get answers to questions here soon. Please post any comments or new questions in separate forum threads, as that will allow us to respond more directly. Thanks, we appreciate your feedback!
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Please, thank you!
     
  3. Viikable

    Viikable

    Joined:
    Apr 12, 2018
    Posts:
    10
    I'm testing with Oculus Rift now, and it seems that the input from the thumbstick isn't passing values through, as it won't show in the controllerSample at all. I've even tried adding the OpenVR variant but nothing, as shown in the picture. I cannot get any values through the XR interaction toolkit either, whereas with the Vive 1 everything else works except the haptic and socket hovering as mentioned prior.

    I got VR hands working and reading trigger and grip values with Rift, but for some reason these values don't get passed to the toolkit through references.
     

    Attached Files:

  4. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Could you clarify what you mean by double images? Do you have a screenshot of what you are seeing?
     
  5. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    First make sure you have the `Oculus Touch Controller Profile` feature enabled in the OpenXR feature list. If you do you can try binding it to `<XRController>{RightHand}/joystick` which should work, but I would think the binding to primary axis should work too.
     
    Last edited: Jan 5, 2021
  6. Viikable

    Viikable

    Joined:
    Apr 12, 2018
    Posts:
    10
    I just tested this, no change. And that would be strange anyway as the Oculus Touch feature profile in the documentation specifies the action should be mapped to thumbstick on the controller. And yes of course I have the profile on, as I already tested Vive with its profile and it works. What I mean is, even when I open the "ControllerSample" scene which comes with OpenXR, and you have the controller mockups which display all inputs, the joystick is not recorded even in there on the default InputActions, and specifying the action to oculus touch controller as I've tried still brings no change.

    All the other bindings DO work though in the controller sample, I get input for the primary and secondary Oculus Touch buttons, trigger and grip normally. Only thing that does not go through is input from the joystick, so I assume it is something to do with that specifically. Although binding these other controls to the XR interaction toolkit still doesn't work very well, but there is some level of registering at least. Without the joystick cannot do locomotion/snap turning at all though, which makes testing very difficult.

    In the image I show how I changed the input the way you told to, with no better results. The way I understood the actions is that adding more bindings to an action won't negatively affect the functionality of the existing ones, correct? Also is the suggested method to always just have a reference to the XRController or not, as I've been trying to add the more specific inputs like the documentation suggested.
     

    Attached Files:

  7. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467

    Are you using the SteamVR runtime? I just verified that the SteamVR runtime does in fact *NOT* track the thumbstick on the oculus at this time. Can you try using the oculus runtime directly? In the OpenXR project settings select oculus and see if the thumbstick works? Thanks
     

    Attached Files:

  8. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Not the OP, but I also observed that when using SteamVR, sticks are not detected, but when using Oculus, they are detected (Rift CV1).


    Filed two bug reports this morning, posting here for visibility to other users in case anyone has found fixes.
    • 1304188: When using Oculus with OpenXR and a Rift CV1, a black circle appears on screen.
      Edit: Duh.
    • 1304190: OpenXR: SteamVR renders a distorted view to the HMD (Oculus Rift CV1)
    Really exciting to see cross platform XR support, super pumped about this :D
     
  9. A1igator

    A1igator

    Joined:
    Apr 12, 2018
    Posts:
    4
    Hey, I did some more testing. It actually works fine if I build for pc. The issue arises when trying to debug with Unity play mode. It looks like the image is duplicated down the middle. It's like looking at a VR display without any lenses. I tried to take a screenshot but oculus screenshot tool just gives a black screenshot in Unity play mode.
     
  10. Viikable

    Viikable

    Joined:
    Apr 12, 2018
    Posts:
    10
    Yes, I was indeed using SteamVR runtime, just swapped to Oculus and it tracks, so that was the problem. Hopefully that can be fixed in the next version.

    Can also confirm this black box appearing when using Oculus as Iron-Warrior said. And I also meant to report about the distorted view with SteamVR and Oculus as well.
     
  11. Viikable

    Viikable

    Joined:
    Apr 12, 2018
    Posts:
    10

    DId the black circle disappear when disabling the occlusion mesh? I just did XRSettings.useOcclusionMesh = false, but the black circle remains. Also as the stick won't work in SteamVR runtime, do you know how to change the runtime to Oculus also in the build, as the settings in the OpenXR only affect the editor instance?
     
  12. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    I am using MRTK 2.5.3. and the update OpenXR Plugin Version 0.1.2-preview.2 is not tracking any device (HMD or controller) (preview.1 is fine).
     
    Last edited: Jan 7, 2021
  13. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    The runtime is a system wide setting. The editor allows you to temporarily override it but which runtime is used it us to the end user basically. We have reported to valve that their runtime does not track some controls. Keep in mind the Steam VR OpenXR support is also in beta I believe.
     
  14. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    The black box is an occlusion mesh bug in the Oculus runtime and that appears to be fixed in the new beta release of that runtime. You can opt into it the beta runtime within the oculus desktop app.
     
    Iron-Warrior likes this.
  15. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Does the game view in Unity render properly?
     
  16. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    wild guess: have you tried rebooting the editor? upgrading packages with native plugins in them requires an editor reboot otherwise the old plugin will still be bound and you'll be in an undefined state.

    If you have rebooted the editor and it's still a problem, can you submit a bug? We will investigate.
     
    eusebium likes this.
  17. rickmus

    rickmus

    Unity Technologies

    Joined:
    Sep 10, 2017
    Posts:
    10
    Please post any new feedback or questions as separate forum threads from now on, as multiple discussions here are difficult to track. Thanks!
     
    FlightOfOne likes this.
  18. A1igator

    A1igator

    Joined:
    Apr 12, 2018
    Posts:
    4
    Yeah it does. I'm using MRTK if that helps. I also have to restart unity sometimes to get it to work at all.

    Edit: steamvr works but there is weird warping on both quest 1 and rift s. like there is motion blur.
     
  19. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Yes, that was it! Thanks!
     
    mfuad likes this.
  20. kittik

    kittik

    Joined:
    Mar 6, 2015
    Posts:
    565
    Hi,

    Since upgrading my project from 2019.x to 2020.2 and setting up OpenXR I can no longer access the Primary Button on a Vive controller (above the thumbpad, to be clear). All other Vive inputs are fine, build for Oculus too, all inputs work. Not sure why, its the only button not working for Vive. I've provided images of my projects XR settings below.

    I am using the below CommonUsages, which worked in 2019.
    Code (CSharp):
    1. if (Controller.inputDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool primaryButton))
    upload_2021-1-8_13-50-5.png upload_2021-1-8_13-49-47.png
     
    hschulte likes this.
  21. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Hi I think I figured out what caused the issue. My project was set to "verify saves" which kept prompting to save every single time something changed.
     
    mfuad likes this.
  22. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    Does "Unity XR Input" still work with this OpenXR plugin?

    https://docs.unity3d.com/Manual/xr_input.html

    My game uses XR Input and the old input manager to query the input states, what I found so far is that the buttons on the VR controllers (Oculus Quest through Link) seem working fine but the axis input are missing. Is this expected?

    Also when enabling Open XR in XR settings, the Oculus toggle is grayed out, and it seems to be launching steam VR instead of Oculus when the game starts, is there a way to let it select the most propriate runtime?
     
  23. FishStickies94

    FishStickies94

    Joined:
    Jul 27, 2019
    Posts:
    70
    OpenXR only works with the new Unity action input system as far as Im aware. You’ll want to switch over to that in all regards to input.
     
  24. dpcactus

    dpcactus

    Joined:
    Jan 13, 2020
    Posts:
    53
    Will this come to Unity 2019.4 LTS too? Any rough estimate when that will be the case? Either preview or final.
     
  25. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I don't think so. Scroll up (first few) and you will see the discussion and it doesn't look that way.

    I recently upgraded my 2019.4 LTS to 2020.2 just to accommodate this package. I was reluctant at first, but I learned that 2020 will go LTS fairly soon.

    You might want to carefully examine the effects before upgrading to 2020 though as some assets and features might not work properly in 2020. In my case everything seems to be working OK and it was well worth it.
     
  26. rickmus

    rickmus

    Unity Technologies

    Joined:
    Sep 10, 2017
    Posts:
    10
    No, 2020.2 and forward only.
     
  27. FishStickies94

    FishStickies94

    Joined:
    Jul 27, 2019
    Posts:
    70
    So we’ve found there are some issues with the OpenXR and Index in the grip readout. The index grip seems to be highly sensitive, a light touch gets you to the full 1 value. Is there anyway around this?
     
  28. shomz

    shomz

    Joined:
    Nov 9, 2016
    Posts:
    16
    Is XRInputSubsystem.TryRecenter() not doing anything a bug or should we use some replacement from the new Input System?
     
  29. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I have a Quest 2 with Virtual Desktop. I have SteamVR Beta 1.16.1 and have many SteamVR games that work great.

    I am trying to get OpenXR in Unity working with this setup. In theory it should work.

    I followed this great video: How to Setup XR Toolkit's Action-Based Input in Unity - YouTube that shows how the Action Based Input works.

    The end result is when I hit play in the editor, it opens SteamVR and I enter my scene. The head tracking works great, but the controllers do not.

    When I look at the properties of the controllers in the rig they have all the actions set up from the Presets that the video walks you through setting up. I also have the rig itself set up with the input script on it mentioned in the video.

    Supposedly the 1.16.1 SteamVR beta passes all of the OpenXR tests for 1.0.

    UPDATE: I decided to try the Oculus link cable and get the same results do it isn't specific to virtual desktop.

    UPDATE 2: Just for reference here is a picture of the SteamVR window. It shows the headset and controllers are tracking. When I hover the mouse over the icons that is what they say.

    https://drive.google.com/file/d/1l5afV1mSR4DI4lvE0k2pGPtW2C28AZ41/view?usp=sharing

    Any ideas why the controllers don't work?
     
    Last edited: Jan 15, 2021
    DavidZobrist likes this.
  30. TriHard7777

    TriHard7777

    Joined:
    Jan 15, 2021
    Posts:
    1
    ive seen 2 people post about the index grip issue, it wont let me make a post so im posting it again here. index controller grip is considered gripping on any touch at all, so if you are just holding the controllers it will grip, and it is very hard to drop items. if anyone found a solution help plz.
     
  31. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    This is what I am doing:

    Code (CSharp):
    1.  
    2.  
    3. [SerializeField]
    4. private float grabActivationThreashold = 0.5f;
    5.  
    6. private bool IsGrabButtonActive => grabAction.action.ReadValue<float>() > grabActivationThreashold;
    7.  
    8.  
    If you are using
    isTriggered 
    then maybe but as far as I can tell (with float) it is NOT all or nothing. It seems to work its way from the bottom of the grip to the top. The more fingers you put on the grip, the higher this value will be, ending at 1. I can swear it takes pressure into consideration too, but I haven't tested this out. Just try it out.
     
  32. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Is it just that the game view looks like a split screen view (ie. showing both eyes)? If so there is a setting at the top of the game view to choose whether you see both eyes or a specific eye.
     
  33. Slobdell

    Slobdell

    Joined:
    Jan 15, 2013
    Posts:
    13
    How do you turn off occlusion mesh? I've tried setting:

    XRSettings.useOcclusionMesh = false;

    and it doesn't do anything about the black box in the upper right.
     
  34. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    234
    Can someone quickly explain to me what the relationship of the Steam VR to OpenXR is?

    Main issue: I tested the test scenes but nothing arrives anymore in my Oculus quest via Link when i hit play in the editor. (In remain in the Steam VR home)

    What did I do:
    I was coming from 2019.4 using steam vr for HTC vive and Oculus quest 2 with their input mapping ( old unity input system, device based rig, no unityXR)
    Everything worked fine here.

    Now I wanted to move to the future reading about OpenXR.

    I deinstalled the steam vr, oculus desktop (is deprecated) and open vr, toggled out all code to the old input system.

    Installed the new input system.
    Upgradede to Unity 2020.2.
    Installed XR Toolkit, Open XR and XR Management package.

    Encountering the issue: The game scene is not shown on editor play mode.
    I remain in the steam vr home.

    Attempts to solve it:
    So re-installed Steam VR (via unity package manager) and tried with the XR rig and the Steam rig, aswell as an example scene of Open XR but nothing arrives in my device anymore.

    What do i miss?

    Do I need the oculus integration? (i did not need this before, only oculus desktop,which is removed in 2020.2)

    There is an Oculus XR option in the unity package manager which did not fix my issue.

    So I also found this which is not avaialble in the unity package manager

    https://developer.oculus.com/downloads/package/unity-integration-archive/


    ??
     
    Last edited: Jan 21, 2021
  35. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    176
    I am trying to set up a scene with XR Interaction Toolkit and Open XR on my HTC Vive Cosmos Elit in Unity 2020.2.1f1

    The rendering on the Vive Cosmos is screwed up. It works for a split second, then it's totally distorted. I can't screenshot it, because in the Editor it looks ok.
     
  36. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    @DavidZobrist I can't really help you with the quest as I have no experience with that but there is no relationship between SteamVR and OpenXR when it comes to usage. Open XR is meant to replace SteamVR (or any other plugins). You do not need the oculus integration either.

    Did you try doing this on a clean project, just 2020, and open XR to see if it at least the HMD work?
    Open XR is all you should need and it should work. You can create your own or install the XR Toolkit if you want the other stuff like interaction tools.
     
    DavidZobrist likes this.
  37. DylanF

    DylanF

    Joined:
    Jun 25, 2013
    Posts:
    55
    If you're using the beta version of SteamVR, try going back to the main branch. The last couple beta versions haven't worked with unity's openxr (testing with an Index).

    Also, I agree that the grip reading on knuckles is too sensitive. It's easy to see in the controller example.
     
    DavidZobrist likes this.
  38. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    234
    @FlightOfOne thanks for the clarification!

    @DylanF Ok this could be the issue indeed but Id like to get it to work withouth Steam Vr if Open Xr can really replace it.
     
  39. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    This is an issue in the Oculus runtime and is fixed in their beta release of the Oculus Runtime. Not sure if that went live or not yet.
     
  40. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    176
    Yeah I was on SteamVR 1.15.19 and encountered the error. I updated to beta 1.15.2 and that made things worse.

    I submitted a bug report.


    *EDIT*
    One issue I can't rule out right now: I only use a single lighthouse.
    I've noticed that when I turn my head around, in some positions, for a split second the image is correct. Is there a mechanism that affects the render texture based on the tracking state?

    *EDIT 2*
    It was the base station. I connected my second base station, and now it works. Weird.
     
    Last edited: Jan 22, 2021
  41. Slobdell

    Slobdell

    Joined:
    Jan 15, 2013
    Posts:
    13
    How do I disable Occlusion Mesh for the renderer?
     
  42. hookmanuk

    hookmanuk

    Joined:
    May 28, 2013
    Posts:
    20
    I too don't have rights to make a new post, so replying here instead...

    Is there an Eta on haptic being enabled for OpenXR?

    If its not going to be soon, is there any way to manually send vibrations to specific devices in the meantime, the Valve Index in my case?
     
    TriHard7777 and Viikable like this.
  43. curtispelissier

    curtispelissier

    Joined:
    Jul 26, 2019
    Posts:
    39
    I'm using OpenXR on 2020.2.2f1 and my Oculus Rift isn't tracked at all (with Tracked Pose Driver or Tracked Pose Drive New Input System). Is there anything to configure ?
     
  44. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    44
    If you're using the Unity Editor, can you switch Project Settings > XR Plug-in Management > OpenXR > OpenXR Runtime to Oculus to track it?
    If it doesn't work after you build it, check the registry HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenXR\1.
    If it's Oculus, it should be in the following path
    C:\Program Files\Oculus\Support\oculus-runtime\oculus_openxr_64.json

    The specifications are here.
    https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/specification/loader/runtime.adoc
     
  45. curtispelissier

    curtispelissier

    Joined:
    Jul 26, 2019
    Posts:
    39
    I set the OpenXR Runtime to Oculus and I have a black sprite in the right corner of the view (in game view and headset). upload_2021-1-27_10-33-4.png

    And when I set the OpenXR Runtime to SteamVR, the black sprite disapear but there is a distortion of the view in the headset.
     
  46. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    176
    I also noticed the distortion in the headset when using OpenXR with the Oculus Quest.
     
  47. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    If you update to the latest version of Oculus desktop that should go away, it was a bug in the Oculus runtime. You may have to opt into the beta as I am not sure if it is officially launched yet.

    For Steam VR there is a known issue with distortion with their runtime, again I would opt into steam vr's beta feed so you can get the most up to date version of their runtime.
     
  48. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Silly question, are you putting it on or just moving it around in your hand? OpenXR requires user presence to track anything and I know thats bit me a few times myself. If thats not the case I would need you to send a sample project to look at to figure out what is going on. Thanks
     
  49. curtispelissier

    curtispelissier

    Joined:
    Jul 26, 2019
    Posts:
    39
    For both solutions, the game we are working on will be released on the Steam and Oculus store, so we can't ask players to set their platform on beta. I'm using the latest Oculus Desktop version 23.0.0.43.517).

    My question is outdated, we fixed everything by using the XR Device Action-based
     
  50. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Understood but OpenXR is still a preview package and Oculus and Steam VR are still in beta phases of their runtimes as well. So it just a matter of timing for release versions to be published.
     
    DavidZobrist and hookmanuk like this.
Thread Status:
Not open for further replies.