Achieving the required frame rate for the HMD is essential for a good VR experience, and this must match the refresh rate of the panel used in the HMD. On DK2 this must be 75fps, and for the Gear VR, it must be 60fps. If the frame rate drops below this, it is particularly noticeable to the user, and will often lead to nausea.
While achieving a consistent frame rate is essential, the GPU in the attached PC must also be capable of outputting the required resolution at the HMD panel’s refresh rate. In the case of DK2, this is 1920 x 1080 at 75hz. Bear in mind that if you’re intending to develop for the commercially released Oculus Rift (CV1), this has a 2160 x 1200 resolution at 90hz, which will be more demanding than the DK2.
If you are using the DK2, please make sure that your hardware is capable of outputting the required resolution at the required refresh rate. Many laptops use a chipset to switch between the discrete and integrated chipsets, and these chipsets are usually unable to output 1920 x 1080 at 75hz, leading to a sub-optimal VR experience, and nausea. Please refer to the Oculus documentation, and the Oculus Ready PCs guide for recommended hardware.
Step 1: Create a new empty project from the Unity Home Screen which loads when you first launch Unity. Make sure it is set to 3D.
Step 2: Go to File > Build Settings from the top menu. Select Android as the platform. Set Texture Compression to ETC2 (GLES 3.0).
Make sure you are working in a 3D space. *Note, when previewing a VR project by entering display mode, you will not see two side-by-side images but one image as it would be viewed by the player!
Go to Edit > Project Settings > Player. In the Player Settings (> Other Settings > Rendering) window, check off Virtual Reality Supported.
Build a scene to test. Perhaps a small cube on a floor? Place objects in front of the main camera.
Save your scene (File > Save Scene).
Enter Play Mode to ensure your scene looks good.
Save your project!
The setup is simple, in theory.
Step 1: Bring in an OVRPlayerController object. You will use this instead of the standard FPS controller.
Step 2: Attach a Main Camera as a child of the OVRPlayerController.
Step 3: This Main Camera from the OVR library should have the VRCameraUI and TrackingSpace as children.
Step 4: To move the player, use one of the attached scripts and place it on the OVRPlayerController. For a simple movement that moves the player forward with one tap, in the direction in which you are looking, use the OVR_PlayerMove script. For forwards and backwards movement, use the GearVRInput script (has ability to add left and right movement).
Step 5: If you are having broken or double vision, or the reticle is not following the head movement, disable the CenterEyeAnchor under the TrackingSpace object.
To set up your environment for Gear VR development, you’ll need to set up both Unity and your phone for Android development first. Keep in mind that the consumer GearVR supports the Samsung Galaxy S6, S6 Edge, S6 Edge+, S7, S7 Edge, and Note 5 handsets only at present:
Enable developer settings on your phone by following this guide, then enable USB debugging on the developer menu.
Get an OSIG file for your device. Place it in the Assets/Plugins/Android/assets/ directory of your project.
Refer to this guide if you need more assistance!