GoogleARCore.LightEstimate

An estimate of lighting conditions in the environment corresponding to an AR frame.

Summary

Constructors and Destructors

LightEstimate(LightEstimateState state, float pixelIntensity, Color colorCorrection)
Deprecated. Please use constructor LightEstimate(LightEstimateState, float, Color, Quaternion, Color, float[,], long) instead.
Constructor for a LightEstimate.
LightEstimate(LightEstimateState state, float pixelIntensity, Color colorCorrection, Quaternion directionalLightRotation, Color directionalLightColor, float ambientSHCoefficients[,], long timestamp)
Constructor for a LightEstimate.

Properties

AmbientProbe
SphericalHarmonicsL2
Gets ambient spherical harmonics estimated by ARCore.
ColorCorrection
Color
Gets the color correction RGB scaling factors to be applied to the final color computed by the fragment shader to match the ambient color.
DirectionalLightColor
Color
Gets the estimated color of the main directional light in the world.
DirectionalLightRotation
Quaternion
Gets the quaternion rotation of the main directional light estimated by ARCore.
Mode
Gets the light estimation mode for the current session.
PixelIntensity
float
Gets an average pixel intensity.
ReflectionProbe
Cubemap
Gets the reflection cubemap from the light estimation.
State
Gets the state of the current estimate.
Timestamp
long
Gets the timestamp of the LightEstimate in nanoseconds.

Properties

AmbientProbe

SphericalHarmonicsL2 GoogleARCore::LightEstimate::AmbientProbe

Gets ambient spherical harmonics estimated by ARCore.

It will return a spherical harmonic probe with all 27 coefficients set to zero when the LightEstimateState is invalid or LightEstimationMode is not one of the Environmental HDR modes.

ColorCorrection

Color GoogleARCore::LightEstimate::ColorCorrection

Gets the color correction RGB scaling factors to be applied to the final color computed by the fragment shader to match the ambient color.

The color correction method uses the green channel as reference baseline and scales the red and blue channels accordingly. In this way the overall intensity will not be significantly changed.

DirectionalLightColor

Color GoogleARCore::LightEstimate::DirectionalLightColor

Gets the estimated color of the main directional light in the world.

It will return black when the LightEstimateState is invalid or LightEstimationMode is not one of the Environmental HDR modes.

DirectionalLightRotation

Quaternion GoogleARCore::LightEstimate::DirectionalLightRotation

Gets the quaternion rotation of the main directional light estimated by ARCore.

It will return Quaternion.identity when the LightEstimateState is invalid or LightEstimationMode is not one of the Environmental HDR modes.

Mode

LightEstimationMode GoogleARCore::LightEstimate::Mode

Gets the light estimation mode for the current session.

The light estimation mode.

PixelIntensity

float GoogleARCore::LightEstimate::PixelIntensity

Gets an average pixel intensity.

Values range from 0.0 to 1.0, where 0.0 represents black and 1.0 represents white.

ReflectionProbe

Cubemap GoogleARCore::LightEstimate::ReflectionProbe

Gets the reflection cubemap from the light estimation.

The pixel values are in linear color space. For performance reasons, the cubemap will only be created when this function is called on the LightEstimate object. It will return null when the LightEstimateState is invalid or LightEstimationMode is not one of the Environmental HDR modes.

State

LightEstimateState GoogleARCore::LightEstimate::State

Gets the state of the current estimate.

Timestamp

long GoogleARCore::LightEstimate::Timestamp

Gets the timestamp of the LightEstimate in nanoseconds.

This timestamp uses the same time base as frame timestamp. This timestamp is used to improve performance of the EnvironmentalHDRWithReflection light estimation mode, by ensuring that the Unity environmental reflections are only updated when ReflectionCubemap has changed.

The timestamp of the LightEstimate.

Public functions

LightEstimate

 GoogleARCore::LightEstimate::LightEstimate(
  LightEstimateState state,
  float pixelIntensity,
  Color colorCorrection
)

Constructor for a LightEstimate.

Deprecated. Please use constructor LightEstimate(LightEstimateState, float, Color, Quaternion, Color, float[,], long) instead.

Details
Parameters
state
State of the estimate.
pixelIntensity
Average pixel intensity. Values range from 0.0 to 1.0, where 0.0 represents black and 1.0 represents white.
colorCorrection
Color correction RGB scaling factors to be applied to the final color computed by the fragment shader to match the ambient color. The color correction method uses the green channel as reference baseline and scales the red and blue channels accordingly. In this way the overall intensity will not be significantly changed.

LightEstimate

 GoogleARCore::LightEstimate::LightEstimate(
  LightEstimateState state,
  float pixelIntensity,
  Color colorCorrection,
  Quaternion directionalLightRotation,
  Color directionalLightColor,
  float ambientSHCoefficients[,],
  long timestamp
)

Constructor for a LightEstimate.

Details
Parameters
state
State of the estimate.
pixelIntensity
Average pixel intensity. Values range from 0.0 to 1.0, where 0.0 represents black and 1.0 represents white.
colorCorrection
Color correction RGB scaling factors to be applied to the final color computed by the fragment shader to match the ambient color. The color correction method uses the green channel as reference baseline and scales the red and blue channels accordingly. In this way the overall intensity will not be significantly changed.
directionalLightRotation
The rotation of the main directional light estimated by ARCore.
directionalLightColor
The color of the main directional light estimated by ARCore.
ambientSHCoefficients
A 2D float[3, 9] array that store the spherical harmonics coefficients estimated by ARCore.
timestamp
The timestamp of the LightEstimate.

Send feedback about...