Class ARLightEstimate
An estimate of the real-world lighting around the device, used to shade
virtual content so it blends with the camera image. Poll it through
ARSession#getLightEstimate(); light changes every frame, so no events are
fired for it.
The ambient intensity is normalized so 1.0 means neutral indoor lighting:
platform backends map their native scale to this convention (ARKit reports
about 1000 lumens in a neutral room, ARCore reports a mean pixel intensity
of about 0.18 - both map to 1.0). Values below 1.0 mean the scene is
darker than neutral, values above mean brighter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ARLightEstimateAn invalid estimate with neutral values, returned before the platform produces its first real estimate. -
Constructor Summary
ConstructorsConstructorDescriptionARLightEstimate(boolean valid, float ambientIntensity, float colorR, float colorG, float colorB) Creates a light estimate. -
Method Summary
Modifier and TypeMethodDescriptionfloatThe normalized ambient light intensity.float[]The per-channel color correction as a newly allocated{r, g, b}array of scale factors.booleanisValid()True when the platform produced a real estimate; false for the placeholder returned before tracking starts.
-
Field Details
-
INVALID
An invalid estimate with neutral values, returned before the platform produces its first real estimate.
-
-
Constructor Details
-
ARLightEstimate
public ARLightEstimate(boolean valid, float ambientIntensity, float colorR, float colorG, float colorB) Creates a light estimate. Intended for platform implementations and tests; applications receive estimates from the session.
Parameters
-
valid: whether the platform produced a real estimate -
ambientIntensity: normalized intensity,1.0is neutral -
colorR,colorG,colorB: per-channel color correction scale factors,1.0each is neutral white light
-
-
-
Method Details
-
isValid
public boolean isValid()True when the platform produced a real estimate; false for the placeholder returned before tracking starts. -
getAmbientIntensity
public float getAmbientIntensity()The normalized ambient light intensity.1.0is neutral indoor lighting, lower is darker, higher is brighter. -
getColorCorrection
public float[] getColorCorrection()The per-channel color correction as a newly allocated{r, g, b}array of scale factors.{1, 1, 1}is neutral white light; multiply your content's color by these factors to match the scene's color cast.
-