Environmental Light prefab

Provides environmental light estimation to supporting shaders.

Uses camera sensor data to estimate environmental lighting conditions. Light estimates are accessible to shaders via the _GlobalLightEstimation global shader property.

This prefab must be used if any materials in your scene use light estimation. This includes the following shaders included in the SDK:

  1. ARCore/DiffuseWithLightEstimation
  2. ARCore/SpecularWithLightEstimation

The _GlobalLightEstimation property is used to adjust the shader's final color, for consistency with the camera passthrough image.

Prefab Hierarchy

Game object name Description

Holds the EnvironmentalLight component that is responsible for updating the _GlobalLightEstimation shader property during Update().

Environmental Light game object

Holds the EnvironmentalLight component that is responsible for updating the _GlobalLightEstimation shader property during Update().

This property will only be updated while the current light estimation state is LightEstimateState.Valid.

When this script is missing or disabled, materials that support light estimation will use the last set light estimation value that was set. If the value was never set, materials will render entirely black surfaces, because _GlobalLightEstimation will be initialized to 0 at startup.

Components: GoogleARCore.EnvironmentalLight, UnityEngine.Transform

Send feedback about...