The Power of Light Probes in Unity

Simon Leen
4 min readJul 18, 2021

--

Objective: Show and implement light probes in Unity

When we look at lighting in a game scene, light data and how it is perceived is created or generated using baking. Baking is the process of calculating and saving the light data for use in game and uses this data to light the scene. When objects of light and emissions are changed within the scene, this requires the scene to be rebaked to accomodate the changes and new data.

There are two forms of baking in Unity.

  1. Progressive preview: Allows you to bake in real-time and see results quickly.
  2. Enlighten Mode: The scene has to fully bake before seeing any changes.

In order for either to work the lighting does need to be generated but luckily Unity provides an easy option rather than being responsible for re-generating the lighting manually. This option is called Auto Generate. To set this open the lighting settings and at the bottom of the settings panel click the check box for Auto Generate.

The progressive preview gives you a faster result of how the new baked data looks and even more the progressive preview has a feature called prioritize view which bakes the light data for objects within your view first rather than the whole scene allowing for rapid iterations while developing.

Now as good as this is for baking and generating static object light, games don’t use completely static objects. Games have plenty static objects that do get baked but they also have dynamic moving objects that require lighting data. This is where light probes come in.

Light probes are a group or correlation of lights/sensors that relay baked lighting information to dynamic objects as they pass by/through a light probe group. Using light probes for dynamic objects provides a much more efficient way of providing a type of real-time lighting in games but at a cheaper, less resource hungry way of providing dynamic lighting than using multiple light sources even more so for mobile devices with very limited resources.

To create a light probe group, right-click into the hierarchy, create, light, light probe group.

The yellow points you see in the above image are the representation of the created light probe group. The area within these points will be what uses the statically generated light mapped data to use for dynamic lighting of objects that pass through the light probe group. You can extend this area by creating multiple points or extending the group.

In the above gif, you can see me selecting the side four points, which I then duplicated using the control + D key command before dragging the newly create light probe points out, extending the light probe group area. Setting up a large scale light probe group for a scene can be very time consuming but the benefit for resource usage can be massive allowing a better performance in-game with less lag, faster load times and a better gaming experience.

This scene(shown from both sides of the large room) has one large light probe group but within that group exist thousands of light probes.

In the next post, we will look at creating a transparent window effect in Unity.

--

--

No responses yet