Course contentsShow
← Unity Game Development
Lesson 588 of 8289. Rendering and VisualsFree lesson

Injecting Dynamic Lighting via Light Probes

You will place and distribute light probe groups to capture static light data and apply it to moving objects within your scene.

In this lesson, you will learn how to capture baked lighting data in empty space and inject it into your moving game objects using Light Probe Groups.

The Problem of Static Light

When you use the Progressive Lightmapper to bake global illumination, that lighting information is strictly stored in textures called Lightmaps. These maps are perfectly mapped to static geometry. However, a dynamic player character or a moving enemy cannot "read" these lightmaps. Without a bridge, your dynamic objects would appear flat or disconnected from the surrounding environment’s baked light, even as they move through different zones.

How Light Probes Bridge the Gap

Light Probes act as "sampling points" placed throughout your scene. They record the color, intensity, and direction of the light hitting that specific coordinate in empty space.

When you place a Light Probe Group in your scene, you are creating a volumetric network. Unity treats these probes as vertices of 3D tetrahedra. As your moving object traverses the scene, Unity calculates its position relative to these tetrahedra and performs spherical harmonic interpolation to sample the baked lighting from the nearest probes. This allows your character to transition smoothly from a sunlit hallway into a dark, shadowy room, effectively "inheriting" the baked environment light as if they were truly part of the baked world.

Workflow Tip: Placement

You don't need to fill every inch of your level with probes—that would increase your data overhead unnecessarily. Focus on:

  1. Transitions: Place probes at the thresholds between light and shadow.
  2. Key Areas: Ensure high probe density where characters frequently walk or interact.
  3. Avoid Geometry: Keep probes outside of static colliders to prevent them from sampling light from inside solid objects.

To create them, simply select an empty GameObject, add the Light Probe Group component, and use the "Edit Light Probes" button to duplicate and position the spheres within your Scene View. Once you hit Generate Lighting, these probes will store the irradiance data necessary to shade your dynamic agents.

Key Takeaway: Light Probes act as a spatial sampling grid that allows dynamic objects to interpolate and mimic the baked global illumination of your static environment.