Search Unity

Question Need advice on best way to pivot my project from OpenVR to OpenXR

Discussion in 'VR' started by AzzyDude24601, Apr 28, 2021.

  1. AzzyDude24601

    AzzyDude24601

    Joined:
    Sep 28, 2016
    Posts:
    51
    I have been using the SteamVR plugin and the OpenVR loader in Unity 2019.4 for the past few months but I've been really struggling with the lack of helpful documentation on how to use everything. I've literally had to rely entirely on the SteamVR interaction example scene to reverse engineer the Player prefab and figure out how I can use it for my own VR project. Because I see so many helpful tutorials on YouTube about OpenXR in Unity, and since SteamVR/OpenVR appears to be dying in favour of supporting the OpenXR approach, I am looking to pivot into developing in OpenXR, but I am unsure how to begin.

    The problem is I am so used to working entirely with the SteamVR plugin and the assets it provides, most notably the Player prefab. It is super helpful that it provides custom hand and controller models which react to user's fingers on the controllers. I am using the Valve Index so it is really convenient being able to see the models in game and have the buttons react to my fingers. Is it possible to steal this functionality from OpenVR and use it in OpenXR without writing everything myself? So far, I have the SteamVR plugin installed with the OpenVR loader in the same project as I have OpenXR installed, and both approaches seem to work fine with their respective camera rigs, but it feels like I am supposed to go with one approach or the other.

    Basically, any advice on how "mixable" OpenVR and OpenXR are in the same VR project would be appreciated as I am very used to the SteamVR API and assets. That also includes actions - I have gotten very used to using SteamVR 2.0's action system. Would I need to redo all my actions to match how OpenXR handles them as well? Any advice is welcome.
     
  2. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I suspect you would have to separate yourself from OpenVR to use OpenXR, which would mean changing over to use actions the way OpenXR uses actions, etc. I dont know enough about OpenVR to be able to say that for sure though. Also you will have to upgrade to 2020.3 as OpenXR is not supported in 2019.4.
     
  3. AzzyDude24601

    AzzyDude24601

    Joined:
    Sep 28, 2016
    Posts:
    51
    Hi, thanks for responding. Yes, I am currently working within 2020.3. From my own tinkering, I have determined that you can steal a lot of OpenVR's scripts and use them in OpenXR but it definitely requires some tinkering. It's unfortunate that Valve are not so forthcoming with exactly what they are planning for the future and the documentation/support for what they have done to date is really poor. I have yet to figure out if there is an easy way to re-map my existing OpenVR actions to OpenXR actions. They're both action-based after all, so it seems like it should be possible if you knew what you were doing.
     
  4. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Sounds like you are making progress on your path. I would agree that there should be a way to do what you want to do with the actions, how much work that will be is another question :) If you do manage to get something working it may be worth sharing on git (if you are willing) for anyone else who may take this adventure.
     
  5. AzzyDude24601

    AzzyDude24601

    Joined:
    Sep 28, 2016
    Posts:
    51
    I'm not sure the quality of my code will be worthwhile, but if someone ever finds this thread and needs help, I will try share what I found. However, by then, Valve might have come out with a plugin that 100% interfaces with OpenXR and this won't matter.
     
    the_real_apoxol likes this.