Version: 2017.2
XR SDKs
Vuforia SDK overview

Google VR SDK Overview

Google VR is the technology behind both Google Daydream and Google Cardboard VR platforms. Google VR encompasses support for smartphones, head mounted viewers and controllers, standalone head mounted displays and applications. Google VR provides an SDK for Unity that allows you to build VR content for this rich ecosystem of devices.

Google VR technologies includes Daydream, a platform for high quality mobile VR and Cardboard, built for bite-size VR experiences and 360 video. Daydream consists of Daydream-ready phones, headsets, controllers and experiences and supports high-end Android mobile devices through Daydream. See the full list of Daydream devices on the Google VR) website. Cardboard works with almost any smartphone on both iOS and Android.

Google Cardboard is the most accessible mobile VR solution, allowing anyone with an iOS or Android smartphone to experience VR apps. Cardboard does have minimum and recommended requirements for its usage, but these are much less hardware-bound than Daydream, focusing mainly on the operating system and basic control systems (such as the gyroscope). Users can view VR apps with an official Google Cardboard viewing device, or a third-party VR viewing device which supports Google VR content (See Hardware and Software Requirements section). Cardboard also supports a range of third-party handheld controllers, for apps which require more complex interactions.

Daydream allows more feature-rich experiences than Cardboard, but only supports Daydream ready devices such as Daydream-ready phones, built for VR with high-resolution displays, smooth graphics and high fidelity sensors for precise head tracking. Daydream phone apps are accessible with the Daydream View, Google’s headset and motion controller for experiencing high quality VR, using a Daydream-ready phone. Daydream will also support a Daydream Standalone HMD built by original design manufacturers. Daydream Standalone is an untethered head mounted display running on the Android OS including richer controller input and motion tracking.

See Google’s VR documentation for more information about the requirements and functionality of Cardboard and Daydream.

Hardware and software requirements

This section provides an overview of both the minimum and recommended hardware and software requirements for using the Google VR SDK.

Below are the minimum platform requirements for devices to support the Google VR SDK, along with some important considerations:

  • You must have Android API SDK version 21 (also known as “Lollipop”) installed.

  • To develop Google VR applications, you must have a Cardboard- or Daydream-supported phone.

  • See Google’s documentation on Daydream hardware to learn how to set your Android phone up for Daydream development.

Minimum hardware and software requirements

This section provides an overview of the minimum hardware and software requirements for developing with the Google VR SDK.

Dispositivo Hardware Software
Cardboard - Devices running Android 4.1 or later with a gyroscope.
- Devices running iOS 8 or later with a gyroscope.
- A viewing device compatible with Cardboard.
- Unity Cardboard integration requires Android Lollipop or greater.
- iOS devices with the Google Cardboard application installed.
Daydream - Daydream compatible devices. See the Google Daydream Hardware page for a list of devices compatible with Daydream.

Recommended hardware and software requirements

This section provides an overview of the recommended hardware and software requirements for developing with the Google VR SDK.

Dispositivo Hardware Software
Cardboard - For Android, refer to the documentation provided with your Cardboard viewer for a full list of compatible devices.
- For iOS, any iPhone 5 series or later phone.
- A viewing device compatible with Cardboard.
- Android 5.0 or later.
- iOS 8 or later, with the Google Cardboard application installed.
Daydream - Any device compatible with the Daydream specification. See the Google Daydream Hardware page for a list of devices compatible with Daydream. Android 7 or later.

You can find detailed information relating to Google VR development on the main Google developer site for VR. This site includes links to SDKs, instructional materials, and documentation on APIs and store publishing.

Quick start guide

Esta sección lo ayuda a comenzar a desarrollar aplicaciones de Google VR con Unity. Muchas de las instrucciones para desarrollar contenido de Google VR están disponibles en el sitio web de Google VR Developer.

To install Unity and use the external links for platform-specific setup instructions for the Google VR SDK:

  1. Use the Installing Unity manual guide to help install the Unity Editor.

    i ) When targeting Android make sure to install Unity Android Support through the Unity installer.

    ii) Cuando se dirija a iOS, asegúrese de instalar la compatibilidad de Unity iOS a través del Unity Installer y de que tiene una máquina macOS para compilar e implementar en su dispositivo.

  2. Follow the instructions laid out on the Google developer site for VR for your targeted platform(s).

Google proporciona guías de inicio para desarrollar aplicaciones de Google VR con Unity tanto para Android como para iOS. Los enlaces a guías específicas se dan a continuación:

Platform configuration settings

Esta sección proporciona una guía paso a paso para configurar su proyecto de Unity para construir aplicaciones de Google VR.

Siga los pasos en las siguientes secciones para asegurarse de que su proyecto de Unity pueda construir con éxito para sus dispositivos de Google VR objetivo.

Targeting Cardboard (Android and iOS)

Unity proporciona varias opciones de compilación específicas de la plataforma para crear aplicaciones para dispositivos compatibles con Cardboard.

To access these settings, open the Player Settings (menu: Edit > Project Settings > Player) and navigate to either the Android or iOS section__ (click either on the iPhone or Android icon) depending on which device you want to build to. Navigate to XR Settings__ and make sure the Virtual Reality Supported checkbox is ticked. Next, navigate to the Virtual Reality SDKs list and click the plus__ (+)__ button. Select Cardboard to add it to the list.

Búsqueda de ajustes específicos de la tarjeta de cardboard para iOS/Android (Edit > Project Settings > Player > XR Settings)
Búsqueda de ajustes específicos de la tarjeta de cardboard para iOS/Android (Edit > Project Settings > Player > XR Settings)

Cuando haya agregado Cardboard a la lista de Virtual Reality SDKs, haga clic en la flecha desplegable al lado para ver configuraciones adicionales de Cardboard.

Configuraciones específicas de cardboard en la lista SDK de VR
Configuraciones específicas de cardboard en la lista SDK de VR

La siguiente tabla proporciona una lista de propiedades disponibles en la configuración de Cardboard, junto con una descripción de su funcionalidad.

Property Description
Depth Format Use este desplegable para establecer la profundidad del buffer Z. Unity usa esto para ordenar los datos visibles y determinar qué se representa realmente en la pantalla.
Enable Transition View The transition view is the view that Google VR provides to inform the user that they must put their device in a Cardboard compatible viewer. You can enable it to provide users some time to insert their device into a viewer. By default this is disabled but it can be enabled to provide some time for the user to insert their device into a viewer.

El requisito mínimo de plataforma para Cardboard es Android 5.0 (Lollipop)(SDK API nivel 21).

Para garantizar que Unity use la APK correcta y solo se ejecute en dispositivos actualizados a la última versión de Android, debe cambiar el nivel mínimo de la API.

To do this, go to Player Settings and navigate to Other Settings. Under Identification, use the Minimum API Level drop-down to set it to the latest API in the list.

Establezca Target API Level en API nivel 21 o superior solo para Cardboard. Si se está orientando a Daydream, debe tener 24 o más. Por defecto, esta propiedad usa el nivel más alto que haya instalado. Para obtener más información sobre los niveles de API para Android, consulte la documentación sobre Ajustes de reproductor de Android.

Ahora está listo para crear su contenido de Unity para Cardboard. Siga el mismo flujo de trabajo que para el desarrollo normal de Android o iOS (consulte la documentación sobre Desarrollo de Android o Desarrollo de iOS para obtener más información). Asegúrate de compilar y ejecutar tu juego en un dispositivo compatible con Cardboard (menú: File__> Build & Run__).

Apuntando Daydream (solo Android)

Unity proporciona varias opciones de compilación específicas de la plataforma para crear aplicaciones para dispositivos compatibles con Daydream.

To access these settings, open the Player Settings (menu: Edit > Project Settings > Player) and navigate to the Android section (click the Android icon marked in the figure below). Navigate to XR__ Settings__ and make sure the Virtual Reality Supported checkbox is ticked. Next, navigate to the Virtual Reality SDKs list and click the plus (+) button. Select Daydream to add it to the list.

Encontrar la configuración específica de Daydream para Android (Edit > Project Settings > Player > XR Settings)
Encontrar la configuración específica de Daydream para Android (Edit > Project Settings > Player > XR Settings)

Cuando agrega Daydream a la lista de Virtual Reality SDKs, haga clic en la flecha desplegable junto a ella para ver las configuraciones adicionales de Daydream.

Configuraciones específicas de Daydream en la lista SDK de VR
Configuraciones específicas de Daydream en la lista SDK de VR

La siguiente tabla proporciona una lista de propiedades disponibles en la configuración de Daydream, junto con una descripción de su funcionalidad.

Property Description
Depth Format Use este desplegable para establecer la profundidad del buffer Z. Esto se usa para ordenar los datos visibles y determinar qué se representa realmente en la pantalla.
Foreground Icon Establezca el icono de primer plano para la presentación en Google Play Store de Google.
Background Icon Establezca el ícono de fondo para la presentación en la Play Store de Google VR.
Use Sustained Performance Mode Habilite Sustained Performance Mode para experiencias de XR más largas. Esto reduce el rendimiento para mejorar la vida útil de la batería.
Enable Video Surface Enable Asynchronous Video Reprojection. For more information, see the documentation about Asynchronous Video Reprojection for more information.
Enable Protected Memory Enables memory protection for DRM protected content when using Asynchronous Video Reprojection. This option only appears if Enable Video Surface has been selected. For more information, see Asynchronous Video Reprojection

Properties available for Daydream in Unity Player Settings

El requisito mínimo de plataforma para apuntar solo a Daydream es Android 7.0 (Nougat) (nivel 24 de la API SDK). Si se dirige a Cardboard, así como a Daydream, el nivel mínimo de API compatible es 21.

Para garantizar que Unity use la APK correcta y solo se ejecute en dispositivos actualizados a la última versión de Android, debe cambiar el nivel mínimo de la API.

Para hacer esto en la Configuración del reproductor, vaya a Other Settings. En Identification, __ use el menú desplegable Minimum API Level__ para establecerlo en la API más reciente de la lista.

Configure Target API Level debe establecerse en el nivel API 24 si es Daydream. Por defecto, esta propiedad usa el nivel más alto que haya instalado. Para obtener más información sobre los niveles de API para Android, consulte la documentación sobre Ajustes de reproductor de Android.

Ahora está listo para crear su contenido de Unity para Daydream. Siga el mismo flujo de trabajo que usaría para el desarrollo normal de Android (consulte la documentación en Desarrollo de Android para obtener más información). Asegúrese de compilar y ejecutar su juego en un dispositivo compatible con Daydream (menú: File > Build & Run).

Working with Google VR for Unity

This section covers important considerations you should keep in mind when creating Google VR content in Unity.

When working with Google VR for Unity, note the following:

  • Use the device names daydream and cardboard to load a specific device when you want to enable XR for that device. To do this, call XRSettings.LoadDeviceByName and pass in the string name of the device.

  • Integration of Daydream for Unity takes over the Unity activity’s view hierarchy. This means that any modification made to the view hierarchy before initializing Daydream for Unity, is removed while in XR mode.

Daydream and Cardboard

Daydream and Cardboard have separate entries in the Virtual Reality SDKs list (File > Project Settings > Player > XR Settings). Unity reads the list from top to bottom until it finds a device configuration that works.

Removing or reordering the SDKs in the list affects the functionality of your final built application, as detailed below:

  • If both Daydream and Cardboard are in the Virtual Reality SDKs list, asynchronous reprojection is enabled if running on hardware that supports it. Sustained Performance Mode is enabled if running on hardware that supports it, and if you have enabled it in the Player Settings (see previous section on targeting Daydream). The app appears in all Google Play Stores.

  • If Cardboard is above Daydream in the Virtual Reality SDKs list, the application might not run in Daydream mode, even on Daydream hardware.

  • If Daydream is the only item in the Virtual Reality SDKs list, Unity adds XR Android manifest entries so that the app appears in the XR-specific Google Play store. Daydream requires asynchronous reprojection, so all devices which support Daydream also support asynchronous reprojection.

  • If Cardboard is the only item in the Virtual Reality SDKs list, the app does not appear in the Google VR Play store. Asynchronous reprojection and Sustained Performance Mode are disabled, even on capable hardware.

  • If you plan to support GearVR as well as Daydream and Cardboard, place Oculus at the top of the list. Phones that support GearVR run through the GearVR SDK, and phones that don’t support it fall back to Daydream or Cardboard.

  • If you add None as the first device in the list, Unity starts as a normal application and you can toggle XR through script. See API documentation on XRSettings.enabled and XRSettings.LoadDeviceByName for more information.

Cardboard for iOS

Google distributes the Cardboard Native Development Kit (NDK) for iOS through the Cocoapods library management system. The Unity integration of Google VR uses a specific version of the Cardboard NDK from the Cocoapods manager and this NDK is also used to create your XCode project.

This means the resulting project is generated differently from a standard Unity project. Cocoapods creates a wrapping XCode workspace containing the Unity project as well as a project for the Cardboard NDK library and its dependencies. Always make sure that you open and/or use the workspace and not just the project to avoid linker errors due to the missing libraries in Cocoapods.

Magic Window mode

During development, you may want to have a non-stereoscopic view which still utilizes headtracking. This is useful if you require the user to view a 2D image in XR, or to provide 2D previews of your XR application. This can also be useful for promotional materials. To achieve this, you can access head tracking data when the XRSettings.enabled property is false and the XRSettings.loadedDeviceName is set to daydream or cardboard.

The following example C# code rotates the main camera in a scene by using XR head tracking while disabling stereoscopic view using XRSettings:

UnityEngine.XR.XRSettings.enabled = false;
Camera.main.GetComponent<Transform>().localRotation = UnityEngine.XR.InputTracking.GetLocalRotation(XRNode.CenterEye);

For more information on the above, see the API documentation on XRSettings.LoadDeviceByName.

Hardware volume controls

The Daydream SDK for Unity prevents the native Operating System (OS) from accessing the device’s volume controls. This prevents the OS from displaying the volume user interface (UI) when in XR mode. To access the device’s volume controls manually, extend the standard UnityPlayerActivity (the primary Java class for the Unity Player on Android) and override the onKeyDown and onKeyLongPress key event functions yourself.

For more information on this process, see the Unity documentation on extending the UnityPlayerActivity class through Java.

Note: Unity does not block the volume controls on Daydream controller, so if you only intend to use the controller in your game you may decide not to extend the UnityPlayerActivity at all.

Overriding Daydream Android libraries

The Daydream SDK for Unity provides two libraries to support development for Daydream devices:

  • Daydream native library: gvr.aar

  • Google Protobuf Nano Java library: libprotobuf-java-nano.jar

You can replace either of these libraries by placing different versions of the library files in the Assets/Plugins/Android folder in your project. Library file names must match exactly in order for them to be correctly overridden.

Stereo Rendering methods

Multi Pass rendering is supported on all Google VR platforms. Single Pass rendering is supported only by Daydream on platforms that support driver level instancing.

Supported APIs and SDKs

Esta sección ofrece una descripción general de las API y los SDK compatibles para desarrollar aplicaciones de Google VR con Unity.

Unity API support

Las siguientes APIs no son soportadas por Google VR para Unity:

Supported graphics APIs

The following graphics APIs are supported in Unity on both Android and iOS devices:

Android

  • OpenGL

iOS

  • Metal

  • OpenGL

Controllers and input devices

Daydream controller

The Daydream controller allows 3 degrees of freedom, providing rotational and positional information, a dual axis touch/click controller along with 2 extra buttons. For information on how to take input from this device see the Google Daydream Controller documentation.

Daydream controller
Daydream controller

Features overview

For full details on specific features provided by Google VR, see Google’s Daydream Developer documentation. For an overview of features supported by the Google VR SDK for Unity, see Google’s documentation on Google VR for Unity.

The next section provides a short overview of Google VR supported features.

Supported feature sets

The table below gives an overview of supported features for each target mobile VR device when working with Google VR in Unity.

Device Platform Rendering Input
Cardboard Android Lollipop or later
- OpenGL
- Stereo Instanced Rendering
- Stereo Rendering
Cardboard
iOS
- OpenGL
- Metal
-Stereo Instanced Rendering
-Stereo Rendering
Daydream Android Nougat or later using compatible hardware - OpenGL
- Stereo Instanced Rendering
- Stereo Rendering
Daydream controller

Resources

Useful links

This section provides a number of useful external links for further reading into Google VR development topics.

Troubleshooting guide

This section provides a list of the most common problems you may encounter when developing with the Google VR SDK.

Problem Suggestion
Tengo un problema con GvrController/GvrViewer/GvrXXXX/Vista previa instantánea. ¿Qué debo hacer para resolver esto?
Estos tipos son parte del SDK de Google VR para Unity y son propiedad y están respaldados por Google. Si bien la comunidad general de Unity puede responder sus preguntas, para cualquier problema técnico, debe visitar el sitio SDK de Google VR para Unity en GitHUB.
¿Cuándo se lanzará el Daydream Keyboard? Daydream Keyboard for Google VR es una tecnología de Google y se lanzará en una versión futura del sistema central de Android. El acceso y uso de esta tecnología se basa únicamente en Google y en el SDK de Google VR para Unity.
Estoy intentando construir mi proyecto de Cardboard para iOS, pero Xcode informa de errores de enlazador. Google distribuye el kit de desarrollo nativo de Cardboard (NDK) para iOS a través del sistema de administración de la biblioteca Cocoapods. Unity se integra con una versión específica de Cardboard NDK del administrador de Cocoapods y utiliza el NDK para crear su proyecto XCode. El proyecto resultante se genera de forma diferente a un proyecto Unity estándar. Cocoapods crea un área de trabajo XCode de envoltura que contiene el proyecto Unity, así como un proyecto para la biblioteca Cardboard NDK y sus dependencias. Siempre asegúrese de abrir y / o usar el área de trabajo y no solo el proyecto para evitar errores en los enlazadores debido a las bibliotecas faltantes de Cocoapods.

Consulte el sitio web oficial de desarrolladores de Google VR para obtener más información sobre solución de problemas tanto para Cardboard como para Daydream.


  • 2017–11–21 Page published with editorial review

  • New functionality in 2017.2

XR SDKs
Vuforia SDK overview