cancel
Showing results for 
Search instead for 
Did you mean: 

SDK 0.4.3 Unity free integration not working

TonyVT
Protege
Hello to all! I'm an oculus developer using Unity.
Few days ago I read about the ability to use Oculus with unity free and I was very excited. So I downloaded today the new Oculus Rift SDK0.4.3, updated the firmware and the runtime. All compiled demos work very well.

After that, I tried to import the oculus-unity integration package inside a blank project and... everything went bad 😞 .
At present time, I'm using Unity free version 4.6.0b17 on Windows 8.1 . Oculus device is DK2.

This is what happens:
When I import the package, a compilation error occurs:
Assets/OVR/Editor/OVRShimLoader.cs(46,32): error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `d3d11ForceExclusiveMode'
Assets/OVR/Editor/OVRShimLoader.cs(47,32): error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `visibleInBackground'


So I've opened that file and commented those lines (they don't seem critical lines to me). After that, all compiled well.

So I opened Cubes Scenes, launched it and... an epic fail occurred.
I receive a ton of exceptions. The first is:
EntryPointNotFoundException: ovr_GetVersionString
Ovr.Hmd.GetVersionString () (at Assets/OVR/Scripts/OvrCapi.cs:1309)
OVRManager.Awake () (at Assets/OVR/Scripts/OVRManager.cs:318)

All the milion others are:
NullReferenceException: Object reference not set to an instance of an object
OVRCameraRig.ConfigureCamera (OVREye eye) (at Assets/OVR/Scripts/OVRCameraRig.cs:183)
OVRCameraRig.UpdateCameras () (at Assets/OVR/Scripts/OVRCameraRig.cs:112)
OVRCameraRig.Start () (at Assets/OVR/Scripts/OVRCameraRig.cs:77)

When I move the mouse I also get something like this:
Screen position out of view frustum (screen pos 593.000000, 247.000000) (Camera rect 0 0 811 271)
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32, Int32)


I really don't know what to do. I tried yet:
- rebooting the pc
- redownloading the package and importing it in a brand new project
- changing Oculus Display mode from extended to direct
- copying the OculusPlugin.dll in the Asset and Root folder of the project
- modifying the scripts to initialize the objects after a "tracker initialized" events
but with no luck.

Any ideas in how solving this issue? Am I missing something? Maybe Unity version 4.6 is not supported?
15 REPLIES 15

paulharden
Explorer
0.4.3 unity integration seems to be quite broken, and it seems you have 4.6beta, so spotting the issue can be difficult.
I suggest you to revert to unity 4.5.5 and sdk 0.4.2.
I had a hard time to make 0.4.3 work on unity 4.5.5pro but finally i succeeded, however only running the "directtorift" executable in extended mode 😮
DK2 on Asus Rampage III gene I7 950 @3.2GHz Sapphire R9-290oc, 12Gb Ram Win7 Home 64. Unity5Pro Ms Kinect 1.

TonyVT
Protege
"paulharden" wrote:
0.4.3 unity integration seems to be quite broken, and it seems you have 4.6beta, so spotting the issue can be difficult.
I suggest you to revert to unity 4.5.5 and sdk 0.4.2.
I had a hard time to make 0.4.3 work on unity 4.5.5pro but finally i succeeded, however only running the "directtorift" executable in extended mode 😮

Thanks for the answer. At the moment I'll continue in using OVRAgent... waiting for an Oculus official patch.
I hope the team Oculus sees this message and tries to fix this issue...

DanB
Honored Guest
I believe Unity 4.5.5 is needed if you want Rift support in the free version. If you want to keep using 4.6 beta, then the beta version which is equivalent to 4.5.5 is 4.6 beta 21, which is bleeding edge and described as "Latest release with minimal testing, Has only been spot tested by Unity QA. No Web Player support."

Using D3D11 seems a lot more reliable than D3D9 at the moment, so you probably want to choose it in the player settings too so that you don't need to force it via "-force-D3D11" argument.

vrcat
Honored Guest
I believe that it's been stated elsewhere by Shaver that 4.5.2 and 4.5.5 are the supported versions. Thanks for reporting this issue in 4.6; I've forwarded it to the team.

cybereality
Grand Champion
Unity free support should only work with Unity 4.5.5.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

vrdaveb
Oculus Staff
Unity 4.6 works with 0.4.3, but you have to make a small change to OVRShimLoader as you found. Unity 4.6 Free will not work, but it sounds like you have a pro license.

"TonyVT" wrote:
Assets/OVR/Editor/OVRShimLoader.cs(46,32): error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `d3d11ForceExclusiveMode'
Assets/OVR/Editor/OVRShimLoader.cs(47,32): error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `visibleInBackground'

It should be fine to comment out those lines or change
#if (UNITY_5 || UNITY_4_6 || (UNITY_4_5 && !(UNITY_4_5_0 || UNITY_4_5_1 || UNITY_4_5_2 || UNITY_4_5_3 || UNITY_4_5_4)))

to
#if (UNITY_4_5_5)


"TonyVT" wrote:
EntryPointNotFoundException: ovr_GetVersionString

That means OculusPlugin.dll didn't install properly. Please restart Unity and delete any previous copy of the integration from Assets/Plugins/OculusPlugin* and remove the Assets/OVR folder before importing the new integration.

Also see the migration guide (section 5 in the Unity Integration Guide PDF) for instructions on how to update any of your scripts that use the old integration API.

TonyVT
Protege
Thank you everyone for your answers! They've been very useful...

"vrcat" wrote:
I believe that it's been stated elsewhere by Shaver that 4.5.2 and 4.5.5 are the supported versions. Thanks for reporting this issue in 4.6; I've forwarded it to the team.

Thanks vrcat for reporting the issue to the Oculus Team. I've read about supported versions, too... but I'd prefer not downgrading my version of Unity, if possible.

"DanB" wrote:
I believe Unity 4.5.5 is needed if you want Rift support in the free version. If you want to keep using 4.6 beta, then the beta version which is equivalent to 4.5.5 is 4.6 beta 21, which is bleeding edge and described as "Latest release with minimal testing, Has only been spot tested by Unity QA. No Web Player support."

Ok, In the afternoon I'll give it a try and let you guys know.

"vrdaveb" wrote:
Unity 4.6 works with 0.4.3, but you have to make a small change to OVRShimLoader as you found. Unity 4.6 Free will not work, but it sounds like you have a pro license.

Currently I'm working with the free version, so I'd prefer to have the integration working with Unity free.
I commented out the lines you suggested and started a project from scratch with only Oculus package (sample scenes), but this does not help (maybe with Pro version it works, as you said).

Thanks again to everyone!

cwm3D
Honored Guest
"vrdaveb" wrote:
Unity 4.6 works with 0.4.3, but you have to make a small change to OVRShimLoader as you found. Unity 4.6 Free will not work, but it sounds like you have a pro license.

It should be fine to comment out those lines or change
#if (UNITY_5 || UNITY_4_6 || (UNITY_4_5 && !(UNITY_4_5_0 || UNITY_4_5_1 || UNITY_4_5_2 || UNITY_4_5_3 || UNITY_4_5_4)))

to
#if (UNITY_4_5_5)


I am using Unity PRO 4.6.0b17 with DirectX 11 and have the same problem!! I changed the OVRShimLoader as suggested, which removed the error message. However, it still does not work through the Rift! The demos show in the Unity game area, and the tracking on the HMD is active, but still black screen on the Rift (Orange light on unit/blue light on camera). Do I need to revert to an older Unity (4.55)? Can that be made *absolutely clear* somewhere!?

This is very frustrating, we are using industry standards, and the instructions are not clear as to exactly which mode (direct or extended) is required to use it! (And when) There should be crystal clear instructions (preferably a video) showing proper setup to help customers. As it is, the docs breeze past setup, and it's a crap shoot digging through tons of forum messages, with no clear path. This should be streamlined by now. Everything should move to the "direct2rift" solution as a standard, and the method for Unity to use it should be well communicated.

vrdaveb
Oculus Staff
"cwm3D" wrote:
However, it still does not work through the Rift! The demos show in the Unity game area, and the tracking on the HMD is active, but still black screen on the Rift (Orange light on unit/blue light on camera).

Sorry for the frustration. It sounds like you are using the Unity editor and not a standalone build. Is that correct? To make the editor render to the Rift, you need to switch to extended mode, drag the Game view to the Rift, and maximize it as described in sections 3.2 and 4.4.3 of the Unity Integration Guide PDF that ships with the package. That is also available here: http://static.oculusvr.com/sdk-downloads/documents/OculusUnityIntegrationGuide_0.4.3.pdf. If you build a standalone player and run _DirectToRift.exe, it should appear on the Rift regardless of whether you use extended or direct display mode. Does that work for you?