November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

Getting started with Unity for see-through mode

Download the Google VR SDK for Unity

  • Download the latest GoogleVRForUnity_*.unitypackage from the releases page.

Enabling see-through mode via the Unity prefab

  1. Add the GoogleVR > Beta > Prefabs > GvrBetaHeadset prefab to your scene. Note: GvrBetaHeadset supercedes GvrHeadset. If the GvrHeadset prefab is present in your scene, remove it.
  2. Select the GvrBetaHeadset object in the scene.
  3. Using the component inspector for GvrBetaHeadset, configure see-through mode to be used at the startup of your scene.

Enabling see-through mode via APIs

  1. Check to see if the system supports see-through mode and if it is enabled using the class GvrBetaSettings, its methods IsFeatureSupported(...) and IsFeatureEnabled(...), and the enum GvrBetaFeature.SeeThrough.

  2. If it is supported but not enabled, request the user enable it by calling GvrBetaSettings.RequestFeatures(...) with an array containing the enum GvrBetaFeature.SeeThrough.

    bool supported = GvrBetaSettings.IsFeatureSupported(GvrBetaFeature.SeeThrough);
    bool enabled = GvrBetaSettings.IsFeatureEnabled(GvrBetaFeature.SeeThrough);
    if (supported && !enabled)
    {
      GvrBetaFeature[] features = new GvrBetaFeature[] { GvrBetaFeature.SeeThrough };
      GvrBetaSettings.RequestFeatures(features, null);
    }
    

    The GvrBetaHeadset class provides the CameraMode and SceneType properties that let you set see-through mode and scene type, respectively. You can also use SetSeeThroughConfig to set both properties simultaneously.

    GvrBetaHeadset.SetSeeThroughConfig(GvrBetaSeeThroughCameraMode.RawImage,
                                       GvrBetaSeeThroughSceneType.Virtual);
    

To ensure your scene composites with see-through mode properly, make sure the Clear Flags option for the main camera is set to Solid Color and the Background color is set to black with 0 Alpha.