Hi
Is there a way to add support for both on the same game? The plugins and scripts seems incompatible so you can’t have one game supporting both VR systems, or so that seems.
Anyone managed to achieve it? what’s the trick?
Hi
Is there a way to add support for both on the same game? The plugins and scripts seems incompatible so you can’t have one game supporting both VR systems, or so that seems.
Anyone managed to achieve it? what’s the trick?
SteamVR appears to support that, from here:
My game only works with a game pad and Oculus headset. Is it hard to make it work on the Vive too?
It is pretty simple to get your game working on the Vive on Steam. You will want to download the OpenVR SDK and target this for one of your launch options on Steam. It is great if you can make use of the Vive controllers and room-scale in your title, however it is not required to support the Vive and SteamVR.
You can still require a Xinput controller and even target the Rift and Vive simultaneously using OpenVR on Steam. Steam VR supports both the Rift and Vive headsets along with sitting, standing and room-scale experiences using a mixture of input devices. SteamVR is a flexible place for VR!
That’s in theory. In reality when I plug the oculus with the openVR I don’t get it to work. I have to set it to OculusSDK but then the Opensdk stops working
In Unity 5.4 you get a list of Unity Native VR API’s so you can setup support for multiple ones and have some control.
I would assume that alternative methods other than native unity ones, and add-ons that go beyond the basic functionality provided by native support, are more likely to clash, especially at this stage of the game. I only have oculus DK2 hardware so I can’t really test this stuff out but if it were me I’d probably try a 5.4 beta and not install any additional Unity VR assets, and see if you can get both working in this barebones manner first.
you can’t. I guess nobody has done it yet from the answers I read.
The only way I see it is to detect at runtime the returned values on the VR names and load certain prefabs or another.
I would say an even better question is this- what can I do today to ensure (or at least- make more likely) compatibility with tomorrow’s VR head and handsets?
I did a quick test on my project with 5.4.0b18. If the Vive is the first SDK listed, the rift runs through OpenVR and works fine. If the Oculus SDK is the first listed, the rift runs through the Oculus SDK. If you are using the SteamVR camera prefab, the tracking when using the Oculus SDK is over sensitive but if you use a regular Unity camera, it works fine. The Vive seams to work no matter how you set it up.
I guess that the best solution to get the two to play nicely is to have the Oculus SDK listed first and have separate camera setups depending on whether a rift or vive is connected. You could just use OpenVR for the rift but then you would miss out on ATW.
yeah, that’s what I’m doing: load different stuff depending on what VR is detected.
But I was hoping Unity was able to save me from VR nightmare. Because I also have to consider now Google Cardboard and Samsung Gear VR. It seems I have to create different assets for every single one of them.
Also in the case of Android, if you enable support for VR and your phone doesn’t have the Gear connected, instead of loading normally without VR on, it will crash immediately. Very messy right now.
Is it not because of the Manifest.xml ? I have yet to try, but i guess it could work by overriding it.
Edit : Why would you let VR support enabled for regular android app ? I would go with multiple apk.
I have been working on a Rift/Vive application. I used the OVR camera rig and Steam picks it up fine after adding OpenVR, but now after adding open VR the application crashes when opening on the Rift. (tries to open it through SteamVR instead of using Oculus’ launcher)
It looks to me like the SteamVR Camera Prefab causes the problem of overly sensitive (2x) tracking.
I think this happens because the Prefab has two Cameras in it, one for the Head, and one for the Eye. Which calls the Oculus SDK twice for headtracking, making it double up.
This seems like a bug or conflict between the Unity Oculus SDK use, and the SteamVR plugin Camera Prefab.
I was going to say just build separate apps for the Oculus Store and Steam but it occurred to me that Steam users have Rift HMD’s too. So is it better to have the OVR SDK as first choice and Oculus SDK as second choice or vice versa? What is the code to find out what HMD they are running?
My goal is to have a single app that works on both Rift and Vive. It’s always possible to do separate apps, but a big part of using a tool like Unity is to make this easier so that we don’t have to.
Using the SteamVR plugin for Unity, from the Asset-Store, you get access to the OpenVR SDK, and the CameraRig Prefab.
I used the CameraRig as a simplifying factor, exactly what I’m looking for in terms of the tools handling abstraction for me.
However… once I use that CameraRig, I get the problem of the doubled up headtracking. Not certain, but I read in a different forum that a user had a similar problem from two cameras. Presumably that should be handled here, but I think it is not.
Because, if I remove the OculusSDK from the list of supported Virtual Reality SDKs (in Settings->Player), and leave only the OpenVR SDK, then the double headtracking is resolved. Importantly, this also still works upon both Rift and Vive. At runtime, it launches SteamVR, which then launches Oculus Home. It mostly does what I want, with the caveat being that I really have no idea what I’m doing, I’m no expert.
The downside is that I no longer have access to the Oculus Remote Control. That seems to only be supported via the Oculus SDK. I can still access the Xbox controller in both.
If you want to use both, you must have the Oculus one first, otherwise it will launch SteamVR. Or use it if you want your Rift users to not be required to launch SteamVR.
If you want to include both SDKs, the way to determine which one is loaded is:
if (UnityEngine.VR.VRSettings.loadedDeviceName == "OpenVR")
{
}
That is the current recommended approach. There was a enum technique which has been deprecated.
Thanks for that info. Becoming an expert in Unity means knowing the workarounds and you are on yer way:) I just sent my Cyclotronica VR game to the Oculus Store last night an am waiting for it to go live. I am going to tackle the Steam Store next so i will jut replace the Oculus SDK with the Open VR one for that store. it won’t be that much of a hassle to mke a specifric build for Steam with just a camera change. i already have the ability to toggle between VR and standard desktop using the V key or B button on the controller. I did not bother with using the Oculus remote. Seems to e it should be using the virtual axis anyways so…and I am assuming everyone with a Rift HMD has an XBox controller… fingers crossed…
As an update here:
I disabled the second camera in the CameraRig prefab, by unchecking the box when CameraHead was selected.
This fixes the double head-tracking problem on Rift as was suspected. This also allowed me to keep both Oculus and OpenVR SDKs in my project, so I could make a single build that worked on both, with full support for Oculus Remote, Vive Controllers, Xbox controller, and keyboard and mouse.
I had expected that to disable the mirror copy to the monitor, but that still works. So… I don’t know if there is any negative side-effect, but it looked good in my testing.
FYI:
I had trouble getting the Oculus controllers to work in a scene with the SteamVR camera rig. The camera was working fine, but OVRInput.GetConnectedControllers() was returning None. After a little digging around, this is what solved it for me:
Hope that helps.
Note that as far as I know, Oculus won’t accept a game into the Oculus Home store if that game supports any other headsets. They check for the presence of the OpenVR SDK and reject any game that includes it.
That’s terrible. They better not.
We wanted to have Native projects but not 2 separate project, so I’ve made small program:
Now we can have native Oculus and HTC project. Share same prefabs (which are different for each) and same scenes and assets. Needs just one click before submitting to repo or after to apply SDK and setting to project.
What are other solutions for that ?
I guess what he means is that Oculus rejects builds which include the openvr DLL. This is the error message you get when submitting:
"The package contains DLL libraries that are known to cause issues when
running on the Oculus platform. These files must be removed prior to
uploading: <path>/Plugins/openvr_api.dll"
So, to submit to the Oculus store you’ll have to remove any OpenVR-based elements (basically create an Oculus-specific build).