Search Unity

Resolved Detect if steam vr/oculus/wmr is installed

Discussion in 'VR' started by Zapan15, Nov 4, 2020.

  1. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    Do you know a way to detect if steam vr, oculus, or any wmr headset is installed (windows, linux, mac)?
     
  2. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    You could use c# to iterate over all assemblies and look for their corresponding namespaces
     
  3. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    Over which assemblies? We have to find a way to detect this on the users pc/mac.
     
  4. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Oh, you meant the user steam vr software, not the unity plugin. Why do you need to know this info?
     
  5. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    In our app you can switch to Screen or VR mode. When switching to VR mode we want to switch to the best possible VR headset. In case only oculus is installed, we will switch to the oculus device, if steamvr is installed only then to steamvr etc. If we detect more then one installation, we will show a dialog where the user can choose which headset he wants to use.
     
  6. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Aren't you distributing your app over the oculus and steam store?
    You could just start oculus vr when its opened from the oculus store and steam vr if its opened from steam.
     
  7. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    The app can be downloaded just from our website, so no direct oculus store/steam integration.
     
  8. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    If you only have the download on your website then there is no point in supporting both runtimes. You could just support OpenVR which supports all steam vr headsets as well as oculus headsets. Even though the easiest way is to use OpenVR (SteamVR) with steam it actually runs without steam just fine.
     
  9. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    Good point! Thank you :)
     
  10. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    What FakeByte Said - You can also check for HMD + controllers being used in OpenVR in case you need to account for differences.
     
  11. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    The case is the following:

    * A PC has 3 installations Oculus, Steam, WMR
    * All 3 Headsets are connected to the PC and are ready
    * The user clicks on the `Start-VR` button in our app
    * Which Headset should we use?
    * We want to show 3 buttons to the user in that case, which suggests to start the given Headset/driver

    The question is now, how should we know which installations are existing on the PC?

    We can easily use the way unity suggests, e.g. just use a standard loading order, Oculus, Steam, WMR. If one of the drivers work, we just use this headset. The Problem with that is, that in this case, always the Oculus headset will be used. Maybe a user want to choose.

    I know, that this is maybe a corner case...
     
  12. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Unity only allows reordering of subsystems before building the project, after building it you can't reorder them, but you can start a specific subsytem, either you try starting subsystems and then stopping them again to see which ones are supported or you ask the user and rely on the user to choose a subsystem that his hardware supports.
     
  13. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    Thats how we are currently doing it, weather automiatc or to ask the user which to use. The point is, we do not want to show the user a dialog whith 3 options (oculus, steam, wmr), but for example, only oculus and wmr is installed. In that case, we want to show a dialog which shows oculus and wmr as option (not all three in that example). So we have to find a propper way, to detect if oculus, steam and wmr is installed on the system. If for example wmr is not installed we do not want to show this as an option in the dialog. And if only one system is installed, we can simply use the autodetection. So in a summary: How can we find out which system is installed, e.g. by checking specific folders on the system, like the oculus installation path etc. The problem here, the user can choose the installation path. Maybe a registry entry etc. can tell that?
     
  14. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Honestly, how many users have multiple VR headsets plugged in at the same time? Why not just tell the user to unplug one headset if it starts on the wrong headset?