# 4. Light Probes and Adaptive Probe Volumes Part of [[Lighting and Baking]]. Previous: [[3.Lightmap UVs and Texel Density]]. Next: [[5.Reflection Probes and Environment Lighting]]. Lightmaps light **surfaces**. Probes light **empty space** so dynamic objects (and probe-lit statics / LODs) receive indirect light that matches the bake. Unity 6 URP supports: 1. **Legacy Light Probes** — you place `LightProbeGroup` tetrahedral networks by hand (or with tools). 2. **Adaptive Probe Volumes (APV)** — automatic placement, **per-pixel** sampling, Baking Sets, adjustment volumes, streaming options. Official: [Light Probes](https://docs.unity3d.com/6000.0/Documentation/Manual/LightProbes.html) · [APV in URP](https://docs.unity3d.com/6000.0/Documentation/Manual/urp/probevolumes.html) · [Use Adaptive Probe Volumes](https://docs.unity3d.com/6000.0/Documentation/Manual/urp/probevolumes-use.html) ## 4.1 What classic Light Probes do During the bake, Unity stores lighting at probe positions. At runtime, a dynamic object's lighting is interpolated from the nearest probes (tetrahedral interpolation). **Primary uses (Manual):** 1. High-quality lighting (including indirect) on **moving** objects. 2. Lighting information for static scenery using Unity's **LOD** system when lightmaps are not used the same way across LOD levels. **Placement instincts** - Dense near color transitions (inside doorway between lit exterior and dark interior). - Cover player volumes and AI walkables — not only floors; include head height. - Avoid probes inside geometry (solid walls) — they sample wrong and tint everything. - Ring major lights; do not only carpet the floor in a uniform grid. ### LightProbeGroup helper (Editor) > [!warning] Not compiled > Utility for laying a rough grid; always prune probes inside mesh colliders by eye or with a physics overlap check you trust. ```csharp #if UNITY_EDITOR using System.Collections.Generic; using UnityEditor; using UnityEngine; public static class LightProbeGridBuilder { [MenuItem("Tools/Lighting/Add Light Probe Grid To Selection")] static void Build() { var go = Selection.activeGameObject; if (go == null) { Debug.LogError("Select a GameObject to hold LightProbeGroup."); return; } var group = go.GetComponent<LightProbeGroup>(); if (group == null) group = Undo.AddComponent<LightProbeGroup>(go); // 5x3x5 grid in local space — tweak before use var positions = new List<Vector3>(); for (int y = 0; y < 3; y++) for (int z = 0; z < 5; z++) for (int x = 0; x < 5; x++) positions.Add(new Vector3(x * 2f, 0.5f + y * 1.5f, z * 2f)); Undo.RecordObject(group, "Light Probe Grid"); group.probePositions = positions.ToArray(); EditorUtility.SetDirty(group); } } #endif ``` ## 4.2 What Adaptive Probe Volumes add APV **automates placement** from scene geometry density and samples lighting **per-pixel** rather than per-object. Unity's URP APV pages cover: - Introduction / use / display - Size and density configuration - **Baking Sets** for multi-scene bakes - Rendering layer masks to fight light leaks - Loading / streaming for large worlds - Lighting Scenarios / sky occlusion for runtime lighting changes - Probe Adjustment Volumes and Probe Volumes Options overrides - Troubleshooting light leaks and seams ## 4.3 Enable and bake APV (URP) Documented workflow ([Use Adaptive Probe Volumes](https://docs.unity3d.com/6000.0/Documentation/Manual/urp/probevolumes-use.html)): 1. **Edit > Project Settings > Quality** — open the active **URP Asset**. 2. **Lighting > Light Probe Lighting** (wording may show as Light Probe System) — set to **Adaptive Probe Volumes**. 3. **GameObject > Light > Adaptive Probe Volume**. 4. Set **Mode** to **Global** to cover the scene (or use local volumes for bounded spaces). 5. Lights that should contribute: Mode **Mixed** or **Baked**. 6. Meshes that should contribute: **Contribute Global Illumination** enabled. 7. Meshes that should *receive* probe lighting: **Receive Global Illumination = Light Probes**. 8. Lighting window: enable **Baked Global Illumination**. 9. **Adaptive Probe Volumes** tab: Baking mode **Single Scene** (or configure a Baking Set for multi-scene). 10. **Generate Lighting**, or from the Generate Lighting dropdown choose **Bake Probe Volumes** to bake APV data only. If no scene in the Baking Set contains an APV, Unity may offer to create one automatically. **Configure after the first bake** - Lighting window **Adaptive Probe Volumes** panel — spacing / behavior for the Baking Set. - Adaptive Probe Volume Inspector — size and density. - **Probe Adjustment Volume** — invalidate or fix probes in a local region (leaks, interiors). - Volume + **Probe Volumes Options** override — changes *sampling* when the camera is inside; does not re-bake. ## 4.4 When to use which (Unity 6) | Use case | Prefer | Why | |---|---|---| | Small levels, tight hand-authored probe rings | **Light Probe Groups** | Predictable, minimal data, battle-tested on mobile | | Medium/large URP scenes, characters moving through varied indirect light | **APV** | Per-pixel quality, less manual placement | | Multi-scene / open world | **APV + Baking Sets** (+ streaming docs) | Designed for this | | Quest / very tight memory & fill-rate | Start with **baked lightmaps + sparse classic probes**; add APV only after profiling | APV adds 3D texture sampling and memory — see part 6 | | LOD static scenery needing probes | Either; classic probes historically common for LOD | Follow Manual LOD + probes guidance | You generally pick **one** Light Probe System on the URP Asset (Legacy vs APV). Do not assume both systems run side-by-side as independent full solutions without reading the current URP asset behavior for your version. ## 4.5 Light leaks with APV Unity documents troubleshooting for APV light leaks (thicker walls, rendering-layer masks, Probe Adjustment Volumes, options overrides). See: - [Troubleshooting light leaks in APV (URP)](https://docs.unity3d.com/6/Documentation/Manual/urp/probevolumes-troubleshoot-light-leaks.html) - Rendering layer mask / probe assignment docs under the URP APV manual tree **Practical leak discipline** 1. Seal Contribute-GI geometry (no paper-thin single-plane walls between bright/dark). 2. Use Adjustment Volumes to invalidate probes that sit in walls or see both interior and exterior. 3. Do not "fix" leaks by raising Indirect Intensity globally. ## 4.6 APV setup notes (checklist form) ```text [ ] URP Asset → Light Probe System = Adaptive Probe Volumes [ ] Adaptive Probe Volume in scene (Global or locals covering gameplay) [ ] Mixed/Baked lights only for baked contributors [ ] Static receivers: Contribute GI + Lightmaps where atlased [ ] Dynamic receivers: Receive GI = Light Probes [ ] Lighting Settings: Baked GI on [ ] APV tab: Single Scene or Baking Set configured [ ] Generate Lighting / Bake Probe Volumes [ ] Inspect with APV visualization; add Probe Adjustment Volumes for leaks [ ] Profile memory on target device before shipping APV on Quest ``` Next: [[5.Reflection Probes and Environment Lighting]].