Stay organized with collectionsSave and categorize content based on your preferences.
TheLighting Estimation APIprovides detailed data that lets you mimic various lighting cues when rendering virtual objects. ARCore supports three light estimation modes:
This mode is automatically enabled when the following criteria are met:
Ambient Spherical Harmonics, Main Light Direction, and/or Main Light Intensity are selected in the Light Estimation mode provided by theAR Camera manager
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["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)."]]