public final class ARLightEstimate
- Object
- 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.
Fields
public static final ARLightEstimate INVALID | An invalid estimate with neutral values, returned before the platform produces its first real estimate. |
Constructors
public ARLightEstimate(boolean valid, float ambientIntensity, float colorR, float colorG, float colorB) | Creates a light estimate. |
Methods
public boolean isValid() | True when the platform produced a real estimate; false for the placeholder returned before tracking starts. |
public float getAmbientIntensity() | The normalized ambient light intensity. |
public float[] getColorCorrection() | The per-channel color correction as a newly allocated {r, g, b} array of scale factors. |
Inherited methods
Field details
INVALID
public static final ARLightEstimate INVALIDAn 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
validboolean- whether the platform produced a real estimate
ambientIntensityfloat- normalized intensity,
1.0is neutral colorRfloat- ,
colorG,colorB: per-channel color correction scale factors,1.0each is neutral white light colorGfloat- Not documented.
colorBfloat- Not documented.
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.0 is 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.