Geprüft mit Version: 5.1
Only static objects are considered by Unity’s Baked or Precomputed Realtime GI systems. In order for dynamic objects such as interactive scene elements or characters to pick up some of the rich bounced light that our static geometry receives, we need to record this lighting information into a format which can be quickly read and used in our lighting equations during gameplay.
We do this by placing sample points in the world and then capturing light from all directions. The color information these points record is then encoded into a set of values (or ‘coefficients’) which can be quickly evaluated during gameplay. In Unity, we call these sample points, ‘Light Probes’.
Scene using Light Probes. Notice how they have been placed in greater density around areas of lighting change - such as shadows or color transition.
Light Probes allow moving objects to respond to the same complex bounced lighting which is affecting our lightmaps regardless of whether Baked GI or Precomputed Realtime GI is used. An object’s mesh renderer will look for the Light Probes around its position and blend between their values. This is done by looking for tetrahedrons made up by the position of Light Probes, and then deciding which tetrahedron the object’s pivot falls into. This allows us to place moving characters in scenes and have them appear properly integrated. Without Light Probes, dynamic objects would not receive any global illumination and would appear darker than surrounding, lightmapped geometry.
By default there are no Light Probes in a scene so these will need to be placed using a Light Probe Group (GameObjects>Light>Light Probe Group).
If the ‘Auto’ box is checked at the bottom of your scene precompute settings (Lighting>Scene>Auto), Light Probes will update whenever changes are made to the scene lighting or static geometry. Otherwise they will be updated when the Build button is clicked.
In this document we have given an overview of the considerations which need to be made prior to setting up a scene for lighting. We have also briefly looked at the tools available for creating various lighting effects. However, there is still a lot which we haven’t yet covered.
For a more in-depth look at optimizing your Scenes for Unity's Precomputed Realtime GI please see our tutorial here.