The Power of Light Probes in Unity
Objective: learn how to use light probes to pass light data to dynamic objects.
In this scene, the lighting data is baked into the static objects. This allows for much more realistic lightning in the scene. For example, this glowing cube creates a slight glow on the ground beneath it. However, that glow is “baked in” and will not move with the object.
In order to change the light data so the ground is update with the new position of the cube, we would have to go to the Lighting window and click Generate Lighting. We could also turn on Auto Generate so that the scene will take a few moments to recalculate the lights every time a light source moves.
However, some objects are meant to be able to move around the scene. We want those objects to be realistically lit as well. This sphere actually does get updated lighting when it moves, even though its not updating the light map. How does that work?
The secret is an invisible web of objects called Light Probes. These keep track of the baked light data of the scene and use it to illuminate dynamic objects that move around.
Setting up light probes can be a lot of work. Fortunately, this scene already has hundreds of them set up in proper locations in order to keep track of what areas are lit by glowing surfaces and which areas are not.
We can think of those little yellow balls as light “sponges” that soak in the baked light data, and then apply that light to dynamic objects that move around. With gizmos turned on in the scene view, we can see which light probes affect an object as we move it around the scene.