Rapid prototyping for Virtual Reality, getting started

I volunteered to play around with a Samsung GearVR that found its way to our offices. The GearVR itself is a headset that houses a Samsung Galaxy S6 that is used as the rendering device and the display. GearVR uses the Oculus Virtual Reality SDK. While this may be the most self-contained, portable and simple way to get a VR system up and running, it is limited in processing power by the S6. The Oculus Rift on the other hand, can be connected to any kind of PC with a powerful hardware in it to run pretty much anything but you will need to have the PC available. Laptops with good processing power and powerful GPU:s tend to be very bulky and expensive, so the use case might be restricted to a desktop PC environment.

Next generation VR consumers watching a VR video of a helicopter journey over Iceland.

Next generation VR consumers watching a VR video taken from a helicopter over Iceland.

I decided to take a rapid prototyping path as that would allow me to produce stuff quickly if and when somebody actually thought up something concrete; like a PoC for a customer. To this end I decided to re-invent as few wheels as possible and make use of as many free and readily available tools as possible.

As VR applications are very much like games in that they usually encompass a 3D world with the user moving in it, or at least observing from a selected viewpoint, a natural choice to start the development was an existing game engine to build upon. There are game engines like Unity, Unreal Engine and CRYEngine that integrate Oculus VR natively, or at least are very simple to integrate with.
My choice was Unity, since I was already very familiar with it and it provides a lot of the wheels I don't wish to re-invent.

Then to business of setting up the development environment. I won't go through the process step by step, since the instructions are available online for anyone wanting to have a go.
Firstly the things to install:
Android Studio and SDK.

I already had this installed. This is required because the platform was the GearVR, and it needs the Android compiler. It will require a bit of configuring before the compiler works properly and you can deploy to the device.

Oculus SDK, Mobile version, for the GearVR

The S6 also requires the GearVR application installed and Unity needs a signature file that can be generated from the Oculus website with the GearVR serial number.

Unity

Unity did not require extensive configuring to take the Oculus into use. The OculusVR SDK package for Unity requires little more than two operations of drag-and-drop to get going. Couple of project settings later I had the first hello world scene running in the device.

Unity editor view with Oculus components placed.

Unity editor view with Oculus components placed.

That was relatively painless? Now to actually do something with it.

Bit of fiddling and I got the Android sphere images set as Unity skybox. There is a built-in mapping for the type of projection sphere images are saved in, which is nice. They give a nice background to look at.
If you have not noticed yet, your Android phone can take sphere panorama images. You may need to install the app, depending on the manufacturer. My Nexus5 had it automatically in the default camera app, S6 didn't but it was available as a free download. Its pretty cool. There is a Google+ community for Photo-Sphere images here.

Next step was dropping some content in the "scene". I downloaded some free-to-use 3d-model of a house and dropped it in the Unity project. A bit of automatic importing later I added it into the scene and recompiled. Now I had a house to look at. The Oculus Unity default components handle the head tracking control near flawlessly out of the box. There is very little control interface outside the head movement tracking, in the GearVR. For the Rift I would have keyboard and mouse to work with.
Next step would probably be to integrate a Bluetooth game controller to the S6 for controlling movement.

That was approximately two evenings of casual playing with the device. Not too shabby as far as developer friendly goes. I've spent longer on setting up simpler development environments, so I can appreciate the ease of use the Unity integration for Oculus provides.

 

Avatar

Jouni Laaksonen

Join the conversation