Google VR Quick Start

GoogleVRHT_BannerImage_00.png

Goals

This Quick Start guide shows you how to set up a Unreal Engine 4 (UE4) project to work with Google VR.

Objectives

  • Create a new UE4 project that is targeted towards Google VR development.

  • Setting the required project settings so your project can be used with Google VR.

  • Deploying and viewing your UE4 project with the Google VR HMD of your choice.

1 - Google VR Project Creation

In this part of the Google VR Quick Start, we will go over how to create a new UE4 project that has the best settings for Google VR development. 

Steps

  1. From the Epic Games launcher make sure that you have downloaded and installed UE4 version 4.12 or later. Once that is completed, press the Launch button to open the Unreal Project Browser.
    Click for full image.
  2. In the Unreal Project Browser, go to the New Project section and select the Blueprint base project option.
    Click for full image.
  3. Due to the demanding rendering requirements of VR in general, it is best to start out any new UE4 VR project with the following settings to ensure that your project will run at the correct frame rate right from the start.
    Click for full image.
    • Blank Project
    • Mobile / Tablet
    • Scalable 3D / 2D
    • No Starter Content
  4. Set the location where the project will be created and also give the project a name.
    Click for full image.
    • For this example the project name will be GVR_QS.
  5. Finally, press the Create Project button that is located in the lower right-hand corner to create the project.
    Click for full image.

End Result

In the next section of the Google VR Quick Start, we will go over all the needed project settings to ensure that your UE4 project will work with Google VR.

2 - Google VR Project Setup

In this part of the Google VR Quick Start, we will go over setting up your Unreal Engine 4 project so that it can be used with Google VR.

Steps

  1. Once the Editor has loaded, from the Main Toolbar, open the Edit tab and select the Plugins menu item. 
    GVRQS_Save_Level_00.png
  2. Inside of the Plugins menu, go the Virtual Reality section and make sure that Google VR is enabled.
    Click for full image.
    The Google VR Plugin should be enabled by default. It can be enabled by clicking on the checkmark box next to Enabled. When you do this will be prompted to restart the Editor so that the changes can be applied. Failing to re-start the Editor after enabling the Google VR Plugin could result in the Plugin not working correctly.
  3. From the Main Toolbar, select the File option and then click on the Save option to bring up the Save Level As window.
    GVRQS_Save_Level_01.png
  4. From the Save Level As window under the Name section, name the level EntryLevel and then press the Save button.
  5. Back on the Main Toolbar, select the Edit menu option and then select the Project Settings menu option.
  6. From the Project Settings menu, go to the Maps & Modes section. Under the Default Maps section, change the Editor Startup Map and Game Default Map to EntryLevel to make sure that EntryLevel will be loaded when the project is run.
  7. Back in the Project Settings, under the Target Hardware section, make sure that Target Hardware class has been set to Mobile / Tablet and the graphics level has been set to Scalable 3D or 2D.

    If you see the Restart Editor button under the Pending Changes section, make sure to press it to restart the editor, so the changes that are made will be applied. Failing to do this could result in your project not working with Google VR.
  8. In the Rendering section, make sure that Mobile HDR is disabled. This is necessary for correct stereoscopic rendering.
  9. Under the Input section in the Mobile category, remove the DefaultVirtualJoysticks from the Default Touch Interface by clicking on the small white triangle next to DefaultVirtualJoysticks and selecting the Clear option from the drop-down list.
    GVRQS_Remove_Virtual_JoySticks.png
  10. Under the Android section (in the Platforms heading), press the Configure Now button in both the APKPackaging and Google Play Services categories to ensure that our project can package correctly.
    GVRQS_Config_Now_00.jpg
  11. In the APKPackaging category, make sure you have the following options set:
    GVRQS_SDK_Version_00.png
    Property Name Value
    Minimum SDK Version and Target SDK Version 24
    Disable verify OBB on first start/update Checked
    Enable FullScreen Immersive on KitKat and above devices Checked
  12. Locate the Build category and then set the following properties:
    GVRQS_Build_arm64_Support_00.png
    Property Name Value
    Support armv7 (aka armeabi-v7a) UnChecked
    Support arm64 (aka arm64-v8a) Checked
    Support OpenGL ES2 Checked
  13. Next, in the Advanced APKPackaging category, enable the following options:
    GVRQS_GoogleVR_Options_00.png
    Property Name Value
    Configure Google VR Deployment Mode Daydream & Cardboard
    Configure Google VR for sustained-performance mode Checked
    The Configure Google VR Deployment Mode has several options that when selected will do the following: 
    Property Name Description
    Cardboard Configure Google VR to run in Cardboard-only mode.
    Daydream Configure Google VR to run in Daydream-only mode. In this mode, the app won't be able to run on Non Daydream-ready phones.
    Daydream & Cardboard Configure Google VR to run in Daydream-only mode. In this mode, the app won't be able to run on non-Daydream-ready phones
  14. In the Android SDK section, under the SDKConfig category, set SDK API Level to latest and set the NDK API Level to android-19 to ensure that your project will be compiled against the most recent Android SDK.
    GVRQS_Android_SDK_Options_00.jpg
  15. For your Unreal Engine 4 Daydream projects to properly deploy to a Daydream device, you need to make sure that CodeWorks has installed the following components.
      Android SDK Platform 24
      Android NDK 12b
      JDK 1.8
    To see how to install additional Android SDK's check out Installing Additional Android SDK's for more information.

End Results

In the next section of the Google VR Quick Start, we will go over what you have to do to package your project so that it will run on a Google VR device.

3 - Google VR Project Packaging & Deployment

In this section of the Google VR Quick Start, we will go over what you have to do to package your UE4 project so that it will work with a Google VR device.

Before going any further make sure that the Smartphone you are using is plugged into your development PC via a USB cable. Then make sure that ADB can see your phone as an authorized device. If you are unsure how to do or are having problems getting ADB to see your device, check out the following page for more information Android How To Set Up Your Android Device.

Steps

  1. To start the packing process, go to the Main Toolbar and from the File menu go to Package Project > Android > Android (ASTC).
  2. Once Android( ASTC) format has been selected, you will be presented with a Windows dialogue box. From this dialogue press, the Make New Folder option and call the folder Androids_Builds. Once the folder has been created, press the OK button to begin the packing process.
  3. While the project is being packed, a status window will be displayed in the lower right-hand corner of the UE4 Editor.
    For a more detailed look on what is going on during packing, click on the Output Log window.
    Click for full image.
  4. Once the project has been packaged, open the Androids_Builds folder and double-click on the Install_GVR_QS_Development-armv7-es2.bat file to install the project to your Android Smartphone.
    For this to work, you will need to make sure that your Android Smartphone is plugged into your development PC via a USB cable. Failing to do this will result in the project not being installed on the device.
  5. Once the .BAT file has been run, a command line window will be displayed showing you the progress of the install. When the install is complete, the command line window will automatically close.
  6. Now on your Smartphone look for an Application called GVR_QS. When located, tap on the GVR_QS Application icon to launch the project.
  7. When the GVR_QS project is viewed through a VR Headset, you should see something that looks similar to the following image.
    Click for full image.
    To make sure that your phone and UE4 are properly configured for the VR device you are using, click on the Gear icon that is displayed while the app is running. From the displayed menu, you can scan the QR code that is on the side of your VR HMD, and that will make sure UE4 outputs an image that is compatible with your VR HMD.

End Result

When completed you will be able to view the UE4 project using Google VR like in the following video.

4 - On Your Own!

Now that you can deploy a UE4 project to your Android based smartphone and view it with your Google VR HMD try adding the following items.
  • Use the Migrate Tool to move content from one of the mobile content examples into your project for use.
  • Adjust the settings of the Default Device Profiles to ensure that your project will run as fast as possible when deployed to your Android based smartphone.
  • Use the GPU Profiler to help track your projects performance while you are building it.

As for specifics covered in this quick start: