The Power of Light Probes
Objective: learn about light probes, their use and how to edit them
Continuing our journey on trail of lights and illumination in Unity, we cannot skip the light probes.
Light probes are a feature that allow to collect lighting data coming from static objects — such as self-luminance of materials with emission channel — and pass them to dynamic objects making them act like lights. It may take hours and hours of work, putting probes and probes all around the scene but in the end it will pay off with a stunning illumination and very poor performance decrease, if compared to real light sources needed for the same result.
Let’s have a look at the scene, at the security desk. It has some self-luminance on it, and on the side there is a cube with a really intense emission channel values. So, basically they are static objects.
Both the objects show the following properties in the Mesh Renderer component: “Contribute to Global Illumination”.
If you look at the hint description you can get by hovering the mouse on it, you’ll quickly understand that materials like these will affect the illumination of the world around them, in particular in terms of light probes.
Let’s now take a look at the sphere object. It is not set to contribute and, because of this, another section appeared: Probes. This means that the sphere will instead exploit the light probes to emit light, in the way specified in the dropdown menu.
If you look at the scene, after selecting the sphere, you’ll notice some strange wires.
You can also notice that those wire change if you move the sphere.
Those dots are the light probes themselves, and the wires show how they are connected. Moving the sphere will make it rely on a different sub-group of probes, depending on the sphere position.
Is it possible to watch them all? Yes, as it is possible to manipulate their position and number, to reach the desired coverage and effect. If you find the Light Probe Group in the hierarchy view and select it, here is what you see on the scene.
Thousands of probes scattered around the scene. To make this possible, it was necessary to click on the Edit Light Probes button, this will enable the section below.
Now you can select one or more single probe by clicking (or ctrl-click) on them. The selected ones will turn blue. You can move them, delete them or duplicate them to rapidly reach the desired number.
So in this scene, using just one real light source (a sun-like one) and a lot of emission channel, we can still have a rich and vivid illumination if we have enough patience with the probes. The great performance of the game will be our prize.