This article brought to you by ARM.
Join ARM at booth 1624 at the Game Developers Conference 2016 and view the Ice Cave Demo in full VR
There’ll be plenty to see and do at this year’s GDC so don’t forget to stop by the ARM booth and check out all the exciting innovations, including the Unity based Ice Cave Demo, described in detail below, on full VR
We’re hosting a series of sponsored talks on mobile game development including how to get the best from mobile VR, as well as a live lecture theatre on-stand where you can see expert presentations on all the latest game development tools and techniques.
Our booth will also be hosting the latest and greatest demos and releases from our partners. See Epic, nDreams and Cocos and check out Nibiru’s VR platform and SDK, Deepoon’s latest all-in-one VR headsets, and Umbra’s culling software which lets you to fly over cities with Google Earth and Samsung Gear VR!
Not only that, we are also giving away Bluetooth HID controllers for the Gear VR and a high-performance Android tablet after each lecture theatre talk! Plan which talks to attend with the lecture topics and schedule available here. Last but not least, we have a wealth of game developer tutorials to optimize your games for mobile platforms and we are looking forward to sharing our latest findings.
We’re especially keen to show you the Ice Cave demo which was recently ported to VR on the Samsung Gear VR headset. The process of porting to VR was interesting and presented us with a few challenges so we hope you’ll find it useful to see how we went about it:
Ice Cave – Porting to VR
Ice Cave, the flagship demo from ARM Mali Ecosystem, has been shown with great success at many recent major events. The demo has been developed in Unity and aims to demonstrate that it is possible to render high visual quality content on current mobile devices. A number of highly optimized special effects were developed in-house, specifically for this demo, some of which are based on completely new techniques, for example the rendering of shadows, refractions and even the Tauyuan effect, all based on local cubemaps.
Figure 1 View of the cave from the entrance in the Ice Cave demo.
The Ice Cave demo was released at a time when Virtual Reality has become the centre of attention in the game development community, and related events and media. A number of VR demos and games have already been released but VR performance requirements can limit the complexity of VR content and therefore the visual quality of the final VR experience.
It is in this landscape that the Ecosystem demo team decided to port the Ice Cave demo to Samsung Gear VR and this task was assigned to me. In this blog I describe my experience in porting the Ice Cave demo to VR during my eight weeks summer placement in the Ecosystem demo team.
By the time I joined the demo team, Unity had just released a version with VR native support for Oculus Rift and Samsung Gear VR. Previously, VR support was only available by means of a plugin based on Oculus Mobile SDK, but this had some obvious limitations:
Each VR device has a different plugin
Plugins may conflict with each other
Release of newer VR SDKs / Runtimes can break older games
Lower level engine optimizations are not possible with plugin approach of two separate cameras
Conversely, the newly released Unity VR native integration lacked both support and sufficient information for developers, and experienced many unresolved issues. Nonetheless, the team was convinced that with the native integration in Unity we would be able to achieve the best possible performance; a key point in guaranteeing a successful VR user experience.
2. Samsung Gear VR
The Samsung Gear VR headset does not have a built in display but has instead been designed to host a mobile phone. At the time of writing, the Samsung Gear VR comes in two versions; one for Samsung Note 4 and another for the latest Samsung Galaxy S6. Some of the main specifications of the Samsung Galaxy S6 version are listed below.
Samsung Gear VR is powered by Oculus VR software and incorporates the Oculus Asynchronous Time Warp technology. This important feature helps reduce latency, or the time taken to update the display based on the latest head movement; a key issue to avoid in VR devices. Besides the Time Warp technology, the Samsung Gear VR has several sensors which it uses in place of the ones incorporated in the phone.
The Samsung Gear VR has its own hardware and features a touch pad, back button, volume key and, according to the specifications, an internal fan designed to help demist the device while in use.
The key point here however, is that you can insert your Samsung Galaxy S6 into the headset and enjoy an immersive experience with just a smartphone. We are no longer limited to the screen size of the phone and can instead become completely immersed in a virtual world.
3. Main steps to port an app/game to VR in Unity
VR integration in Unity has been achieved following one of the main Unity principles, that it must be simple and easy. The following basic steps are all that are needed to port a game to VR:
Unity 5.1 version with VR native support (or any higher version).
Obtain the signature file for your device from the Oculus website and place it in Plugins/Android/assets folder.
Set the “Virtual Reality Supported” option in Player Settings.
Set a parent to camera. Any camera control must set camera position and orientation to the camera parent.
Associate the camera control with the Gear VR headset touch pad.
Build your application and deploy it on the device. Launch the application.
You will be prompted to insert the device into the headset. If the device is not ready for VR you will be prompted to connect to the network where the device will download Samsung VR software.
NB. It is useful to set the phone to developer mode to visualize the application running in stereo without inserting into the Gear VR device. You can enable the developer mode only if you have installed previously a VR application appropriately signed.
Enabling Gear VR developer mode Developer mode allows you to launch the application without the headset and also dock the headset at any time without having Home launch. |
Figure 3. Steps to enable VR Developer mode on Samsung Galaxy S6.
Figure 4 Side by Side view of stereo viewports captures with VR developer mode enabled.