In this lesson, you will learn how to configure the Progressive Lightmapper to achieve high-fidelity indirect lighting through baked global illumination.
Understanding the Progressive Lightmapper
While real-time lighting is excellent for dynamic objects, it can be computationally expensive for complex scenes. Baked Global Illumination (GI) allows us to pre-calculate how light bounces off surfaces, storing that data in lightmaps. The Progressive Lightmapper is Unity’s path-tracing-based system that provides a fast, iterative workflow, allowing you to see high-quality lighting results in the Scene view almost immediately while it continues to refine the bake in the background.
Configuring Your Scene
To use the Progressive Lightmapper, first ensure your objects are marked as Static in the Inspector. This informs the engine that these surfaces do not move, making them candidates for baking.
Next, navigate to Window > Rendering > Lighting. Under the Lightmapping Settings, select Progressive GPU or Progressive CPU as your Lightmapper.
- Lightmap Resolution: Defines how many texels are used per world unit. Increase this for higher detail, but be mindful of memory usage.
- Lightmap Padding: Determines the gap between UV islands in the lightmap to prevent "light bleeding," where light from one surface erroneously leaks onto another.
- Indirect Resolution: Controls the resolution of the indirect light data. Keeping this value lower than your lightmap resolution can save significant bake time without sacrificing perceived visual quality.
The Bake Process
Because the Progressive Lightmapper uses an iterative approach, you don't have to wait for a 100% completion bar to assess your lighting. You can evaluate the "bounce light"—the soft, secondary illumination caused by light hitting a surface and reflecting onto another—as it converges.
// Example: Triggering a bake programmatically via script
using UnityEditor;
public class LightmapBaker : MonoBehaviour {
public void RunBake() {
Lightmapping.BakeAsync();
}
}
By tweaking the Lightmap Parameters asset (specifically the Indirect Light Scratchpad and Anti-aliasing settings), you can refine the quality of those bounces to ensure your static geometry feels grounded within the environment.
Key Takeaway: The Progressive Lightmapper provides an iterative, path-tracing approach to pre-calculating light bounces, enabling high-quality static illumination that significantly optimizes rendering performance for complex scenes.