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. NemesisWarlock

    NemesisWarlock

    Joined:
    Jan 21, 2017
    Posts:
    141
    So I seem to be getting some headset jitter/warping when I use my Oculus Quest 2 (In Link mode!) in OpenXR. Anyone else getting this, or is it something I should be looking at more deeply?
     
  2. Ctuchik

    Ctuchik

    Joined:
    Dec 28, 2013
    Posts:
    5
    After upgrading to v 1.1.1 of the plugin it seem like controller rotation has changed for the Touch controller. The forward vector of the controller is now rotated about 45 degrees up. Tested it in a new blank project with a new XR rig. Downgrading to 1.0.3 fixes it.

    Is this an intentional change?
     
  3. connor_g93

    connor_g93

    Joined:
    Nov 18, 2014
    Posts:
    2
    Hey everyone,
    I don't know if anyone else has this problem, but when I click play after setting up everything for openXR the runtime doesn't automatically set to oculus (which is what im using) so my headset stays on the dashboard and doesn't play the app in the editor or build.

    It only works when I manually set it to Oculus which is editor only so its only a small fix.
    I've followed every tutorial I can find and they all have me do the same thing so I don't know if its a bug or I've missed something.

    Also want to note that I changed XR manager to oculus only and that works perfectly so it only happens when I try to use OpenXR
     
    pguerineau likes this.
  4. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    992
    The work around doesn't seem to work for WMR-G2 (with no error) & has an error on HTC Vive.
    * Do you plan to have some fixes in 2020.3.6 LTS?
    * Are any of these fixes in newer non-LTS Unity versions?
    * Also WMR without OpenXR has very slow / laggy tracking & G2 doesn't work in it (but haptics do). Anyone know why?
     
    Last edited: Apr 27, 2021
  5. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    What is the error on the HTC vive?

    Trying to look into why the G2 isnt working now
     
  6. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Everything looks ok with the G2 interaction feature, haptics should work, unfortunately I do not have a G2 to try it. Am I understanding correctly that you were not able to get it working on any headset yet?
     
  7. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    I have the G2 working on latest 2020 (LTS) relase (2020.3.5f1) with OpenXR
     
  8. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    992
    Yes thats correct.

    I'm asking the person who had it. Will get back on this.

    Haptics are working for you? Can you share some code for how the invocation looks to get it working?
    To clarify G2 works with OpenXR just not haptics for me.
     
  9. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    992
    "What is the error on the HTC vive?"
    -- So he didn't get an error either I guess. Just didn't work. Same as WMR G2.
     
  10. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    If you can send me a sample project that doesnt work or the scripts you are using to fire the haptics I can take a look at it.
     
  11. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    992
    Ok got it working. I'm not sure why it didn't work before. Maybe I had the channel set wrong or maybe my amplitude was wrong
     
    Last edited: Apr 28, 2021
    the_real_apoxol likes this.
  12. S_Thibault

    S_Thibault

    Joined:
    May 31, 2017
    Posts:
    7
    Hello! Quick question so I am sure I am not making a mistake: we are starting production on a VR project using 2020.3 LTS. We plan on having something out in the next 6 to 8 month. Is it ok to use OpenXR or still too risky with our timeline? Should we stay on the classic steamVR/Oculus plug-in?
     
    Iron-Warrior likes this.
  13. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    That is something I would not be able to answer as risk mitigation has too many factors.
     
  14. NemesisWarlock

    NemesisWarlock

    Joined:
    Jan 21, 2017
    Posts:
    141
    I'll Bump and reiterate an earlier post I made:

    Are there any issues with the Quest 2 in OpenXR in Link Mode? All of my Recent OpenXR builds (using SteamVR as the OpenXR Runtime) have had some serious HMD jitter while using a Quest, but it apparently runs perfectly fine on a Vive or Index from testing reports.

    I'm trying to figure out whether this is a Unity Issue, an Oculus Issue, a SteamVR issue, or a combination of all three...
     
  15. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I dont know of any issues personally, I use quest w/ link every day and have not noticed any myself. I am using the beta runtime with oculus though, have you tried that? If you have a sample project I could open it up and see if I see the same issue.
     
  16. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Related to this, on the OpenXR Plugin page only WMR and Hololens 2 are shown as "fully test and officially supported". Is there a timeline or process for other platforms (mainly Oculus PC and OpenVR) to be added to this list? Not looking for anything concrete.
     
  17. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    We are working on updating this documentation now actually. As far as core OpenXR functionality goes (rendering & input) the Windows Mixed Reality, Steam VR, and Oculus Runtimes are all solid. That being said for something like the Oculus, there are features that the Oculus Plugin provides that do not have feature parity in OpenXR yet, if those features are not needed then you should be good to go. We are going to clarify the docs to make the distinction between officially supported and feature parity in the next release.
     
    Iron-Warrior likes this.
  18. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Sounds good, looking forward to it.
     
  19. SpaceOwlGames

    SpaceOwlGames

    Joined:
    Apr 22, 2016
    Posts:
    61
    There was a discussion earlier on this thread about debugging haptics with OpenXR + G2, does this mean that haptics is available with OpenXR, or am I misreading that?
     
  20. LauraAmaro

    LauraAmaro

    Joined:
    Feb 28, 2021
    Posts:
    3
    Hi! I'm working on an app for the Hololens 2. I would like to add Visual Effects with the VFX Graph, so I need to use the Universal Render Pipeline (URP). Just as a test I created a new project with the 3D template and followed this tutorial for the setup (I'm new): https://docs.microsoft.com/en-us/wi...ity/tutorials/mr-learning-base-02?tabs=openxr. Instead of using the samples I placed just a cube in the scene, built and deployed it on VS. It worked as expected on the Hololens. For some reason, I had to set the visibility of the spatial awareness to none to see the cube and make it work (default MRTK config files for OpenXR).

    Then I added the URP, the URP-Asset and updated the material of the cube. To improve the performance I set the quality level to very low and unchecked the setting Optimize Mesh Data. And once done, I built and deployed on VS again. Well, it doesn't start. After 10 min loading, I decided to stop waiting and tried again with no success.

    I'm using:

    • Visual Studio Community 2019 16.9.4

    • Unity 2020.3.1f1 (LTS)

    • MRTK v1.0.2103.3 beta (MRT-Fundation 2.7.0. preview 3)

    • MR OpenXR Plugin 0.9.2 preview
    I would really appreciate some help! I do not understand why the Hololens can't load the project. It is just a cube! Does URP work with OpenXR?

    Thank you very much in advance.

    Laura
     
  21. CoffeeOD

    CoffeeOD

    Joined:
    Jun 24, 2013
    Posts:
    15
    Does this mean OpenXR plugin supports Steam VR devices, such as HTC Vive and Valve Index, out of the box without requiring OpenVR/SteamVR plugins ? Last time I tried, I could not get input (with Unity new input system) work for SteamVR devices (HTC Vive) without mentioned plugins
     
    Last edited: May 1, 2021
  22. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    Would it be possible to change the FOV in openXR ?
     
  23. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    OpenXR should does support HTC Vive and Valve Index out of the box, all you have to do enable the interaction profiles for them.
     
  24. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
  25. Hobodi

    Hobodi

    Joined:
    Dec 30, 2017
    Posts:
    101
  26. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    PrimaryAxis2DClick
    is just a feature usage for the
    thumbstickClicked
    control. Are you saying that mapping a button action to
    PrimaryAxis2DClick
    does not work? If so we would need to see a test project as we are not seeing that in our test cases. Thanks
     
    Hobodi likes this.
  27. Hobodi

    Hobodi

    Joined:
    Dec 30, 2017
    Posts:
    101
    Thanks,
    thumbstickClicked
    works!
    So it is better to use a
    thumbstick
    instead of a
    primary2Daxis
    too?
     
  28. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Hobodi likes this.
  29. fodel

    fodel

    Joined:
    May 5, 2021
    Posts:
    4
    Je ne pense pas que le plugin SteamVR utilise OpenXR - le runtime SteamVR OpenXR n'est pas encore hors de l'aperçu du développeur.










    192.168.100.1 192.168.1.1
     
    Last edited: May 6, 2021
  30. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    m0nsky likes this.
  31. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Couple questions:
    • We can select a preferred Editor OpenXR runtime in the OpenXR tab of Project Settings...is it possible to expose this functionality to builds/users? One use case is just so we can select the runtime in builds ourselves to test that they both work, as well as allowing users to pick their preferred runtime.
    • Is there a clean way to have both OpenXR and Oculus plugins available to a project? When I select OpenXR as a plug in provider it greys out Oculus. The purpose here is that long term we'd like to use OpenXR and would like to be able to mainly use it right now, but until Quest support is available use Oculus for Quest builds (I'm guessing I could probably toggle them on/off in my build script, but figured I'd ask here first).
    upload_2021-5-8_13-8-14.png
     
  32. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    44
    @Iron-Warrior
    To specify the runtime, set the json path of the runtime in either the registry or an environment variable before initializing OpenXR. Therefore, Unity does not have that feature.

    https://docs.unity3d.com/Packages/com.unity.xr.management@4.0/manual/EndUser.html
    https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/specification/loader/runtime.adoc

    It depends on the current runtime, but it is a bit more convenient to use my library.
    https://forum.unity.com/threads/unity-support-for-openxr-in-preview.1023613/page-5#post-6972887
     
  33. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    For the first question this would be difficult to do because while we populated the list of runtimes in unity it is from a known list rather than an exhaustive list. Since we cannot provide a true list of the available runtimes it wouldn't make sense to provide a selector. I believe this is something the OpenXR working group has discussed or maybe is discussing, a way to make runtime selection easier.

    For the second question if your goal is to use the Oculus plugin on Android and OpenXR on windows then you need to enable Oculus on the android tab rather than on the windows tab.
     
  34. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    Any updates on fixing the offset VR controller models when using OpenXR vs. the Oculus / Steam plugins?
     
  35. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    I'm not entirely sure what you're saying here. Are you saying that because selection of runtime happens before OpenXR is initialized, including the ability to do so in the OpenXR package would be out of Unity's scope? I'm thinking that's not quite what you mean, since you linked your library below that does exactly that.

    Looks like it will help with our problem, nice work :)

    Runtime selection and querying would definitely be valuable, since it seems like from the user end switching the active runtime isn't necessarily straightforward.

    From a practical point of view for our use case I'm just attempting to replicate how the legacy 2019.4 VR stuff worked, where it would attempt to initialize Oculus if it is available, then fallback to OpenVR.

    Ahh duh, of course.

    This has been a problem for us in both OpenXR and legacy VR. Planning to look into a workaround for this, but would be good to have an official fix. Can be demonstrated in the ControllerSample by switching from Oculus to SteamVR runtimes.
     
  36. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    From what I understand the Oculus plugin reports a pose of "hand" which is different from the two poses that the Oculus OpenXR runtime returns which is "grip" and "aim". However there should not be a difference between the Oculus OpenXR runtime and the SteamVR Runtime running oculus. If this is the case we will need to figure out where the offset is coming from.
     
  37. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    One more update. We are going to do an audit of the poses coming from various runtimes and devices and get a better handle on how big this problem is. Once we get that data we can determine where any problems are and how to get them fixed.
     
  38. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    Hi!
    At first I had:
    Unity 2020.3.3
    HDRP 10.4.0
    XR plugin 4.0.5
    OpenXR 1.1.1
    SteamVR 1.16.10
    SRanipal 1.3.2.0
    TobiiXR 2.0.0.174

    It used to work just fine and without anything really changing my Vive Pro Eye suddenly did not show the Unity scene anymore. Just the default SteamVR black surrounding with the concentric circles. The headset seems to work fine and every once in a while it does work!
    Checked Windows (10) for updates. Checked my drivers (see above). Rebooted. Nothing seems to help. Frustrating as it always worked. The only thing I change in my code in the project was some math for some number transformation. Nothing to do with XR or eye tracking.

    So I decided to upgrade:
    Unity 2020.3.7
    HDRP 10.40
    XR plugin 4.0.5
    OpenXR 1.1.1
    SteamVR 1.16.10
    SRanipal 1.3.2.0
    TobiiXR 2.1.1.177

    Now throws an error on the SRanipal that it cannot find the device Initial Eye. And no image in the headset after that.

    Any ideas what to try to get my headset working again??

    Marco
     
  39. Murray_Zutari

    Murray_Zutari

    Joined:
    Jun 1, 2017
    Posts:
    45
    I tried to use the OpenXR plugin today (Unity 2020.3.6f1) with the XR Interaction toolkit preview package (latest) and if I use the Gameobject>XR>Convert camera to XR Rig, I seem to get a working rig. If I use the interaction toolkit menu options and select Room-scale XR Rig (Action-based) the tracking fails (no console errors). If I try the Room-scale XR rig (device based) the tracking works fine.

    The issue seems to be the action-based tracked pose driver, as its the only thing that really changes on the camera between the 3 rigs. The two that work use the normal tracked pose driver.

    First gen HTC Vive
    SteamVR 1.16.10
     
  40. jackpr

    jackpr

    Unity Technologies

    Joined:
    Jan 18, 2018
    Posts:
    50
    When using the XR Interaction package, you need to set up the action map for action-based events to work correctly. Instructions for doing so are in the package documentation, which you can find by navigating to the XR Interaction package in the Unity Editor package manager.
     
  41. jackpr

    jackpr

    Unity Technologies

    Joined:
    Jan 18, 2018
    Posts:
    50
    Hello folks,

    One theme we have been seeing in this forum thread is a discrepancy between OpenXR controller poses and other XR Plugin controller poses (Oculus, WindowsMR, OpenVR, and etc).

    For non-OpenXR plugins, controller poses were defined in disparate ways. By contrast, the OpenXR specification has well-defined definitions for grip and aim poses, which are enumerated here: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_standard_identifiers

    When transitioning from another XR Plugin to OpenXR, you will need to offset your controller models differently to match the new OpenXR poses. This is a consequence of pose standardization.

    You can visualize where the grip and aim poses are by using the Controller Sample which ships with the OpenXR package. You can find this sample by navigating to the OpenXR Plugin in the Unity Editor Package Manager.

    If you notice these poses are appearing in odd places based on the Controller Sample, please post a screenshot along with the hardware and runtime(s) you are using.

    Controller models are tricky in OpenXR. The runtime you are using does not inform the application which physical hardware is being used. For example, when using SteamVR OpenXR, you can't know for sure from an application if the runtime is using an Index controller or an Oculus Touch controller. This is a problem that the members of the OpenXR Khronos group are currently working to solve.

    In the meantime, perhaps consider other visual representations if you can. For example, a hand visual that is driven by grip position (and offset in the x direction slightly) and aim rotation seems to do very well across different controllers. Alternatively you could show a tool or generic controller model at the grip pose and use the aim pose for action-at-a-distance raycasts.

    Attached here you can see an example of a hand visual driven by grip pose position and aim pose rotation.
    Ideal_hand_pose.png ideal_hand_x.png ideal_hand_y.png
     
    wm-VR and Iron-Warrior like this.
  42. Murray_Zutari

    Murray_Zutari

    Joined:
    Jun 1, 2017
    Posts:
    45
    I have set up the controller input actions based on the interaction toolkit sample and my interactions are working just fine. But I had to replace the action based Tracked Pose Driver with the device based one to get tracking of the head to work. I checked the XR interaction debugger and it is picking up position and rotation changes for the centerEye device (under Head Tracking - OpenXR) but image in headset remains locked to the initial frame.
     
  43. jackpr

    jackpr

    Unity Technologies

    Joined:
    Jan 18, 2018
    Posts:
    50
    Some simple details to check here are:
    - Is the Input System enabled in Project Settings -> Player -> Other Settings -> Active Input Handling?
    - In Window -> Analysis -> Input Debugger, is "Lock input to game view" enabled?

    If those don't help, please submit a bug with a minimum reproduction. You can do so in the editor through Help -> Report a Bug. Let me know when you've done so and I'll take a look.
     
  44. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    I'm having an issue with my Vive Pro Eye in a Unity 2020.3.3 project.
    The project uses HDRP (10.4.0), XR Plugin (4.0.5 with OpenXR selected, Single Pass Instance, OpenXR runtime to either SystemDefault or SteamVR and the HTC Vive Controller profile selected even though I do not use the controllers in the app), OpenXR 1.0.3. Also running the 1.3.3.0 SRanipal eye tracking driver in the background.
    The project uses the SRanipal Eye Framework prefab to initialize the eye tracking and the TobiiXR Initializer to initialize the Tobii system.
    Running on Windows 10 with SteamVR 1.16.10.

    Often when starting the application (in the Editor) the view in the headset remains the default view (the black space with circles and the two lighthouses visible). It runs fine on the monitor.
    Ever so often the view does work and everything works fine.
    Using UnityEngine.XR.OpenXR.OpenXRRuntime.name reports steamvr. So the link to SteamVR is there.
    Both the Tobii and the SRanipal plugins report working in the Console.

    Just the image isn't rendered and the problem is intermittent, but more often than not.

    I have my own camera in the scene (simple setup), but I also tried the XR->XRRig without changing anything. Same results.
    I've tried uninstalling all Vive, Steam and SRanipal software and reinstalling it (rebooting). Same results.
    I've tried upgrading Unity to 2020.3.7 and also downgrading the OpenXR and XR Plugins to a few versions back. Same results.

    The only thing that seems to work is to disconnect my Vive (pressing the blue button on the break-out box) and reconnecting it. Then the image is rendered. However, then my sound is gone!

    Anyone any ideas?

    Marco
     
  45. jackpr

    jackpr

    Unity Technologies

    Joined:
    Jan 18, 2018
    Posts:
    50
    Are you covering the presence sensor? In OpenXR, if the user is not "present" in the headset then the session lifecycle may kick back to a state that does not track the hmd. The presence sensor should be located on the inside of the headset, centered just above the lenses. You engage this sensor by having the hmd on your head, covering it with your thumb, or covering it with a sticky note.

    For the nitty gritty, you can refer to the OpenXR spec session lifecycle states https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#session-states.
     
  46. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    Yes, I make sure the sensor is covered so the display in the Vive is actually active before starting the scene in the Unity Editor.

    I seem to have found a work-around that works for now (and for me). It has to do with the SRanipal driver and service for the Vive Pro Eye eye tracking. Might be a bug in the latest 1.3.3.0 version. This is what I do:
    - Whilst Unity (2020.3.3) is open with my project loaded
    - Open the Windows Services window (use the search box)
    - Find the SRanipalService, right-click and Stop it
    - Press CTRL-ALT-DEL and open the Task Manager
    - Find the Vive_Super_Reality_SR_Runtime and End this Task
    - Now restart the SRanipal program (using Windows search bar or in my case double-click the icon on my desktop)
    - Now go back to the Services window and right-click the SRanipalService and select Start

    After that it all seems to work for me and kept working for several Play sessions at least. Weird, but as long as it works I'm not complaining!
     
  47. AnKOu

    AnKOu

    Joined:
    Aug 30, 2013
    Posts:
    123
    I encounter the same issue I think. How did you manage to fix it ?
     
  48. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    288
    What is legal, for example?
     
  49. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Quest 2 Android support is now available in 1.2.0. The legal issues were just internal issues for us to be able to ship their android loader in our package.
     
    gtk2k likes this.
  50. FishStickies94

    FishStickies94

    Joined:
    Jul 27, 2019
    Posts:
    70
    Any idea whats happening with finger-tracking on the index? That's basically the last thing OpenXR needs before it can become the defecto standard for all devices.
     
    DoctorMemory and Qleenie like this.
Thread Status:
Not open for further replies.