VR game development through Google VR

Google has released a VR development kit for Android through Google VR, featuring both Android SDK and Android NDK. These SDKs supports both the Cardboard and Daydream VR platforms.

The developer can jump into VR game development through the following tasks:

  • Head-tracking system
  • Spatial audio
  • Dynamic rendering
  • UI handling
  • 3D calibration
  • Lens distortion correction
  • Stereo geometry configuration

Let's have a look at the Android SDKs for VR game development:

  • Google VR using the Android SDK
  • Google VR using the Android NDK

Google VR using the Android SDK

We will have a look at VR development with the help of the Android SDK. A VR application build can be made with the help of Gradle. Gradle can be used independently or with Android Studio.

The developer can use other tools instead of Android Studio, but it is strongly recommended to use Android Studio for Android builds. It is the most convenient method for VR application development on the Android platform.

The developer is required to check the following factors in order to create a VR application build for Android:

  • Android Studio version 1.0 or higher
  • Android SDK version 23 or higher
  • Gradle version 23.0.1 or higher

Using Android Studio can save users from configuring Gradle settings to build application packages. It also helps the developer identify and update Gradle if required.

The developer can choose Gradle to build an Android application project. In that case, the developer needs to manually edit each build.gradle file of every module to include .AAR declarations for the Gradle build.

The modification has to be done this way:

dependencies
{
  compile(name:'audio', ext:'aar')
  compile(name:'common', ext:'aar')
  compile(name:'core', ext:'aar')
}

repositories
{
  flatDir
  {
    dirs 'libs'
  }
}

Android Studio automatically makes these changes and declares dependencies for each module. This will tell Gradle to look in the libs subdirectory of the corresponding module for the three .AAR declarations. If there is no subdirectory called libs, then the developer needs to create a libs subdirectory inside the module's directory and copy the required .AAR files manually.

Google VR using Android NDK

VR application development using Android NDK is not very different to SDK development. It requires the following components:

  • Android Studio version 1.0 or higher
  • Android NDK
  • Google VR SDK for Android

It is recommended that you use the Android NDK with the Daydream development platform. So, the developer needs to set up the development environment for the Daydream SDK.

The Google VR development kit started supporting NDK development from version v0.8.0 with beta release. From version v0.8.1, it included a native head-tracking system to power up the development.

Android SDK is sufficient to develop VR games with Cardboard, but a few developers like to use native languages such as C++ to develop games. Having a better understanding of technology, a few choose to develop VR games with C++ and OpenGL. In this way, the VR game can be portable to other VR platforms as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.176.5