How to develop for the Oculus Rift with Unity Free

What you'll need:

1. Oculus Rift (duh)

order a DK2 from Oculus VR: http://www.oculus.com/dk2/

buy a second hand DK1 (or DK2) online at your own risk.

lend one from a friend, if you have cool friends. :p

If you haven't done so, create a login at https://developer.oculusvr.com/

At least download and install the Oculus Runtime 0.4.3: https://developer.oculusvr.com/?action=dl

2. Unity

Currently the only Unity Free versions that work are 4.5.51 and 4.6 beta2:

Update: user kersk (Oculus) says the following on reddit: "Yep, at least Unity 4.5.5f1 or 4.6b21 are required for free to work. You'll also want to upgrade since both 4.5.5f1 and b21 have some other good fixes for VR (such as fixing DX9 extended mode being capped @ 60hz, etc)."

Download and install Unity 4.5.5: http://unity3d.com/unity/download/archive

Download and install Unity 4.6 Beta: http://unity3d.com/unity/beta/4.6

Personally tested with 4.5.5f1. The latest stable release. Version 4.6b21 reported to work by davehampson (Unity) on reddit. May be unstable. Has advanced UI, better suited for VR.

3. Oculus Unity libraries

Download 0.4.3 Unity 4 Integration: https://developer.oculusvr.com/?action=dl.

Unzip ovr_unity_0.4.3_lib.zip.

4. Develop!

Read the fine manual:

Make sure you are familiar with Unity and its workflow: http://docs.unity3d.com/

Read the Oculus Unity Integration Guide that's available in the zip and here: http://static.oculusvr.com/sdk-downloads/documents/OculusUnityIntegrationGuide_0.4.3.pdf

Don't forget the Oculus VR Best Practices Guide: http://static.oculusvr.com/sdk-downloads/documents/Oculus_Best_Practices_Guide.pdf

If you want to, you can first test out how they created the excellent Tuscany villa demo:

Start Unity. Create a new project. Double-click OculusUnityIntegrationTuscanyDemo.unitypackage (unzipped in step 3) or import it using Assets -> Import Package -> Custom Package....

To create your own VR scene:

Open an existing project or create a new one. Double-click OculusUnityIntegration.unitypackage (unzipped in step 3) or import it using Assets -> Import Package -> Custom Package.... If your scene has an existing Camera or First Person/3rd Person Controller, disable it by setting it inactive. Add the OVRCameraRig or OVRPlayerController prefab to your scene. The prefabs are located in the Project pane in Assets > OVR > Prefabs and can be dragged into the scene or Hierarchy pane. If you use OVRPlayerController make sure there is a collider (floor) beneath it and set the Y-position at least 1.5 meters above the collider.

You can now:

study and edit the scene.

preview it in Oculus Rift mode: Pressing the Unity Play button will show the scene in stereo view on a normal monitor. Turning the Rift should change the perspective. By setting the Rift to extended mode using the Oculus Configuration Utility, this view can be dragged to the Rift's screen.

build it to a PC or Mac standalone: Make sure the resolution is set to 1920x1080 , Run in Background is checked and Aspect Ratios are set to 16:10 and 16:9 in Edit -> Project Settings -> Player under Settings for PC, Mac & Linux Standalone . Optionally set the Anti Aliasing to 2x or 4x for Standalone in Edit -> Project Settings -> Quality . Choose the Target Platform in File -> Build Settings... and press Build . Run the resulting Projectname_DirectToRift.exe (intended for direct-to-rift mode) or Projectname.exe (intended for extended mode).



Last update: 2014-11-03 | Part of VRmuseum.nl