This site has been permanently archived. The content on this site was last updated in 2019.
Getting started with Unity for see-through mode
Stay organized with collections
Save and categorize content based on your preferences.
Download the Google VR SDK for Unity
- Download the latest
GoogleVRForUnity_*.unitypackage
from the
releases page.
Enabling see-through mode via the Unity prefab
- Add the GoogleVR > Beta > Prefabs > GvrBetaHeadset prefab to your scene.
Note:
GvrBetaHeadset
supersedes GvrHeadset
. If the
GvrHeadset
prefab is present in your scene, remove it.
- Select the
GvrBetaHeadset
object in the scene.
- 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
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
.
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.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["Download the latest Google VR SDK for Unity to integrate virtual reality features into your Unity projects."],["Enable see-through mode in your VR applications using either the provided Unity prefab or by directly interacting with the Google VR APIs."],["Ensure proper scene compositing with see-through mode by configuring the main camera's clear flags to solid color and setting the background to black with 0 alpha."],["Utilize the `GvrBetaHeadset` class to control camera mode, scene type, and other see-through related settings for a more immersive experience."]]],["First, download the `GoogleVRForUnity_*.unitypackage` from the releases page. To enable see-through mode via the Unity prefab, add the `GvrBetaHeadset` prefab to the scene and configure see-through mode in its component inspector. Alternatively, use APIs: check if `GvrBetaFeature.SeeThrough` is supported and enabled using `GvrBetaSettings`, request it with `RequestFeatures` if needed, and utilize `GvrBetaHeadset`'s properties or `SetSeeThroughConfig`. Ensure the main camera's **Clear Flags** are set to **Solid Color** with a black background and 0 Alpha.\n"]]