Search Unity

Unity Unity support for OpenXR in preview

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

  1. rickmus

    rickmus

    Unity Technologies

    Joined:
    Sep 10, 2017
    Posts:
    9
    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:
    803
    Please, thank you!
     
  3. Viikable

    Viikable

    Joined:
    Apr 12, 2018
    Posts:
    7
    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:
    12
    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:
    12
    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:
    7
    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:
    12

    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:
    771
    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. xXAligatorXx

    xXAligatorXx

    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:
    7
    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:
    7

    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:
    36
    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:
    12
    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:
    12
    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:
    12
    Does the game view in Unity render properly?
     
  16. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    283
    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:
    9
    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. xXAligatorXx

    xXAligatorXx

    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:
    36
    Yes, that was it! Thanks!
     
    mfuad likes this.
  20. kittik

    kittik

    Joined:
    Mar 6, 2015
    Posts:
    492
    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
     
  21. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    381
    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:
    22
    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. TheMaximL

    TheMaximL

    Joined:
    Jul 27, 2019
    Posts:
    58
    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:
    4
    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:
    381
    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:
    9
    No, 2020.2 and forward only.
     
  27. TheMaximL

    TheMaximL

    Joined:
    Jul 27, 2019
    Posts:
    58
    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:
    14
    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:
    133
    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 at 5:08 AM
  30. jontorkelson22

    jontorkelson22

    Joined:
    Friday
    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:
    381
    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:
    12
    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:
    7
    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.
     
unityunity