Unity 5.1: Now Oculus UnityPackage import is not required?

Hi folks,

In different threads here i found different posts with 2 orthogonal variants:

  • UnityPackage from Oculus not required since Unity 5.1
  • UnityPachage from Oculus is still required even with Unity 5.1

So, i have no conflicts when i’m using unity package in 5.1 (just fixed a couple of #defines), but it will be great if someone from Unity devs give us a clear answer about it :slight_smile: Current (0.6) version of UnityPackage from Oculus looks like not ready for using with Unity 5.1, but minor fixes makes it fit ok.

Thank you and enjoy our InMind VR game for free :slight_smile:

The Unity Package provided by Oculus is their Legacy plugin and still works with Unity 5.1.0. However, we now have native support in Unity 5.1.0 that doesn’t require that you import the UnityPackage from Oculus into your project. Instead, just turn on Virtual Reality Supported in the PlayerSettings and all of the cameras in your scene that do not draw to a render texture will automatically receive head tracking positional and rotational updates.

Got it, thank you :slight_smile: So i have to apply distortion and fov/IPD settings from Oculus Config Util by my own code?)

We don’t currently have FOV and IPD overwrite values in the VRSettings. We will look at the users config and determine the FOV and IPD based on the values they have in their config. You do not have to access these values and set them manually in your code.

Thank you. So unfortunately now native VR support is unusable for us. Our pipeline is:

  • Check is Oculus device is connected to user PC
  • Switch VR mode accordingly to p. 1

With setting VR mode via Player Settings we are unable to switch it in runtime and without OVR plugin we are unable to determine is Oculus Device is present.
Also it’s a risky job to write our own code to position 2 cameras for 2 eyes without IPD value and make distortion right without knowing about selected lenses setting in Oculus Config Util.

Anyway thank you for this significant step to VR support in Unity, we will be waiting for more controlable integration or for usage examples :slight_smile:

@oleg-chumakov_1 To check if the Device is connected to the PC, you can set the VRSettings.loadedDevice = VRDeviceType.Oculus. If an Oculus Device is present and VirtualRealitySupported is true, the loadedDevice will be set to Oculus. Otherwise it will stay on the DeviceType it currently is. The check to see if the Device is present is automatically done by us internally when you try to switch the loadedDevice.

With regards to writing your own code to position 2 cameras for 2 eyes, I am unsure of why you would need to do this? Do you have a specific use case?

With the Native VR integration, all camera’s in the Scene will automatically create 2 eye and set them apart by the IPD in the users OculusConfig. We will also set FOV accordingly and we handle distortion. So I am a bit confused as to why you would need to handle all of these yourself.

Have you tried the Native integration yet? If not, please read the Manual/Scripting Docs and give it a try. It may help answer some of the concerns you are having. Let me now if you need anything else answered.

Thank you, mine missed point was - 2 eyes auto creation per camera. I thought that i must to combine 2 eyes by myself.
Yep, we’ve tried native integration but currently we are not succeed in creating build (it’s ignoring Oculus). In Editor all is ok.

When you deploy the standalone executable pass -vrmode oculus as a command line option. You should also try logging the VRSettings.loadedDevice and see if that is being set to oculus in the Standalone build. And make sure VRSettings.enabled is true.