Realistically light virtual objects in a scene
Stay organized with collections
Save and categorize content based on your preferences.
The Lighting Estimation API provides detailed data that lets you mimic various lighting cues when rendering virtual objects. ARCore supports three light estimation modes:
- Disabled
- Ambient Intensity mode
- Environmental HDR mode
Prerequisites
Make sure that you understand fundamental AR concepts
and how to configure an ARCore session before proceeding.
Enable Lighting Estimation
Follow these steps to enable lighting estimation in your app.
- Set up an AR Foundation project or ARCore Extensions project.
- In the Hierarchy tab, navigate to XR Session Origin > AR Camera.

- Under the AR Camera Manager component, select Light Estimation.
- In the Light Estimation drop-down menu, select the mode(s) you wish to use.

Enable Environmental HDR mode
Environmental HDR mode enables the following light estimation settings:
This mode is automatically enabled when the following criteria are met:
Enable Ambient Intensity mode
Basic light estimation is automatically enabled when Ambient Intensity mode is selected in the ARCameraManager
component.
Ambient Intensity mode enables the following light estimation settings:
- Ambient Color
- Ambient Intensity
Once you have obtained the correct lighting settings, you can light the virtual objects in your scene as if they were a part of the real world.
The ARCameraManager
component can raise a frameReceived
event that estimates frames’ lighting conditions when lighting estimation is enabled. Information from frameReceived
events are stored in ARCameraFrameEventArgs
structs as ARLightEstimationData
.
Follow these steps to change a light’s parameters at runtime.
- Create or modify the existing Directional Light in your scene.
Attach a new script to the Directional Light.
// Sample Lighting Estimation script
Light light;
void Awake ()
{
light = GetComponent<Light>();
}
void OnEnable()
{
if (cameraManager != null)
cameraManager.frameReceived += FrameChanged;
}
void OnDisable()
{
if (cameraManager != null)
cameraManager.frameReceived -= FrameChanged;
}
void FrameChanged(ARCameraFrameEventArgs args)
{
// Modify `light` parameters using ARCameraFrameEventArgs.
}
Modify this new script to detect changes in lighting. For examples of how to do this, check out Unity’s BasicLightEstimation.cs
and HDRLightEstimation.cs
scripts.
Use environment probes in your scene
Follow these steps to enable environment probes in your scene.
- Enable automatic placement in your scene’s
ARSessionOrigin
.
- Add an
AREnvironmentProbeManager
component to the ARSessionOrigin
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eThe Lighting Estimation API enables virtual objects to realistically reflect real-world lighting conditions within AR experiences.\u003c/p\u003e\n"],["\u003cp\u003eARCore offers three light estimation modes: Disabled, Ambient Intensity, and Environmental HDR, each providing varying levels of lighting detail.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can enable lighting estimation by configuring settings on the AR Camera Manager component within their Unity project.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize lighting data, developers can access light estimation information through the ARCameraManager's frameReceived event and apply it to virtual objects in the scene.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment probes can be enabled to further enhance lighting realism by capturing and applying environmental reflections to virtual objects.\u003c/p\u003e\n"]]],[],null,["# Realistically light virtual objects in a scene\n\nThe [Lighting Estimation API](/ar/develop/unity-arf/lighting-estimation/introduction) provides detailed data that lets you mimic various lighting cues when rendering virtual objects. ARCore supports three light estimation modes:\n\n1. Disabled\n2. [Ambient Intensity mode](/ar/develop/unity-arf/lighting-estimation/introduction#ambient_intensity_mode)\n3. [Environmental HDR mode](/ar/develop/unity-arf/lighting-estimation/introduction#environmental_hdr_mode)\n\nPrerequisites\n-------------\n\nMake sure that you understand [fundamental AR concepts](/ar/develop/fundamentals)\nand how to [configure an ARCore session](/ar/develop/unity-arf/session-config) before proceeding.\n\nEnable Lighting Estimation\n--------------------------\n\nFollow these steps to enable lighting estimation in your app.\n\n1. Set up an [AR Foundation project](/ar/develop/unity-arf/getting-started-ar-foundation) or [ARCore Extensions project](/ar/develop/unity-arf/getting-started-extensions).\n2. In the **Hierarchy** tab, navigate to **XR Session Origin \\\u003e AR Camera**.\n\n1. Under the **AR Camera Manager** component, select **Light Estimation**.\n2. In the **Light Estimation** drop-down menu, select the mode(s) you wish to use.\n\n### Enable Environmental HDR mode\n\n[Environmental HDR mode](/ar/develop/unity-arf/lighting-estimation/introduction#environmental_hdr_mode) enables the following light estimation settings:\n\n- [Main Light Direction](/ar/develop/lighting-estimation#main-directional-light)\n- Main Light Intensity\n- [Ambient Spherical Harmonics](/ar/develop/unity-arf/lighting-estimation/introduction#ambient_spherical_harmonics)\n\nThis mode is automatically enabled when the following criteria are met:\n\n- Ambient Spherical Harmonics, Main Light Direction, and/or Main Light Intensity are selected in the Light Estimation mode provided by the [AR Camera manager](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/#ar-camera-manager)\n- [Environment probes](/ar/develop/unity-arf/lighting-estimation/introduction#environment_probes) are enabled in an [`AREnvironmentProbeManager`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/environment-probe-manager.html)\n- A compatible [camera configuration](/ar/develop/unity-arf/camera-configs) is selected\n\n### Enable Ambient Intensity mode\n\nBasic light estimation is automatically enabled when [Ambient Intensity mode](/ar/develop/unity-arf/lighting-estimation/introduction#ambient_intensity_mode) is selected in the [`ARCameraManager`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/#ar-camera-manager) component.\n\nAmbient Intensity mode enables the following light estimation settings:\n\n- Ambient Color\n- Ambient Intensity\n\nUse lighting information in your scene\n--------------------------------------\n\nOnce you have obtained the correct lighting settings, you can light the virtual objects in your scene as if they were a part of the real world.\n\nThe [`ARCameraManager`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraManager.html) component can raise a [`frameReceived`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraManager.html#events) event that estimates frames' lighting conditions when lighting estimation is enabled. Information from [`frameReceived`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraManager.html#events) events are stored in [`ARCameraFrameEventArgs`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraFrameEventArgs.html) structs as [`ARLightEstimationData`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARLightEstimationData.html).\n\nFollow these steps to change a light's parameters at runtime.\n\n1. Create or modify the existing Directional Light in your scene.\n2. Attach a new script to the Directional Light.\n\n // Sample Lighting Estimation script\n\n Light light;\n void Awake ()\n {\n light = GetComponent\u003cLight\u003e();\n }\n\n void OnEnable()\n {\n if (cameraManager != null)\n cameraManager.frameReceived += FrameChanged;\n }\n\n void OnDisable()\n {\n if (cameraManager != null)\n cameraManager.frameReceived -= FrameChanged;\n }\n\n void FrameChanged(ARCameraFrameEventArgs args)\n {\n // Modify `light` parameters using ARCameraFrameEventArgs.\n }\n\n3. Modify this new script to detect changes in lighting. For examples of how to do this, check out Unity's [`BasicLightEstimation.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/BasicLightEstimation.cs) and [`HDRLightEstimation.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/HDRLightEstimation.cs) scripts.\n\n### Use environment probes in your scene\n\nFollow these steps to enable [environment probes](/ar/develop/unity-arf/lighting-estimation/introduction#environment_probes) in your scene.\n\n1. Enable automatic placement in your scene's [`ARSessionOrigin`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARSessionOrigin.html).\n2. Add an [`AREnvironmentProbeManager`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/environment-probe-manager.html) component to the [`ARSessionOrigin`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARSessionOrigin.html)."]]