A Guild to Beautiful Games

Working with Light probes

Light probes are a function within Unity that creates a giant custom mesh within your scene that collects and store light and shadow data that are lighting up the surfaces within scene. They allow dynamic objects such as the player or other interactable object to inherit that stored information when moving within an static scene.

As you can see here, the Light behind the wall isn’t going to be lit properly.

There are two primary uses for Light probes, the first use is to provide higher light data that includes indirect light bounces to moving dynamic objects. The second use for Light probes is to provide lighting information to static scenery when that scenery is using the Unity LOD (Level of Detail) system.

An good example for using Light probes is a scene with exterior scenery, when you have direct lighting but there are some hard shadows that don’t allow objects within that shadow to reflect light data. This means that all objects within that shadow won’t have any color nor detail show up. With Light probes you are able to pass along those light data that reflect some light into that shadow. This allows some of the color and texture to reappear again without ruining your shadow and without adding another light source into the scene.

Setting Up the Light Probe:

To start working with Light probes we first need to create an Light Probe Group, this is the 2 x 2 mesh grid that will control the light data. Right click in the Hierarchy > Light > Light Probe Group.

With the mesh visible we are able to start adding more probes to our meshes.

By selecting the “Edit Light Probes” button, you are able to freely select which point of light in the mesh to move and also Duplicate. The probes will turn blue when selected so you will know which one is active.

Once you have the mesh set to the size you desire we can start testing the light probes. Remember that Light Probes only work on Dynamic objects, therefore we can not make these two sphere “static” but we can make the cubed wall diver and also the floor as static. When setting objects to static, make sure that the objects are able to contribute to Global Illumination.

Now when the sphere in the shadow starts moving, you will see that near the edge of the wall, it will start receiving light data and start illuminating. We can see a side by side comparison when the Light probe is off and when the light probe is on.

The great thing about Light probes is that when you set your light source to “Baked” you can still use the light probes to produced a quick view of what the lighting will be like when hitting on the surfaces of dynamic objects without re-baking over and over again.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store