In this lesson, you will learn how to unify static lightmaps with dynamic light sources to achieve high-fidelity visual consistency in your scenes.
The Hybrid Lighting Philosophy
When building complex environments, baking every light source into a lightmap results in static, lifeless scenes, while relying solely on real-time lighting can crush your performance budget. The solution lies in Mixed Lighting, which allows you to leverage the performance of precomputed indirect lighting alongside the flexibility of real-time shadows.
Selecting the Right Mode
In your URP/Built-in light settings, you have three primary modes for Mixed lights:
- Subtractive: The most performant. Baked lighting handles everything, and real-time shadows only render for dynamic objects.
- Shadowmask: The industry standard for high-fidelity. It bakes indirect light into lightmaps and stores shadow information in a dedicated texture (the Shadowmask). This allows dynamic objects to cast shadows on static surfaces while still receiving smooth, baked contact shadows.
- Distance Shadowmask: Extends the shadow distance for dynamic lights, cross-fading from real-time shadows near the camera to baked shadows in the distance.
Achieving Visual Parity
The biggest challenge in mixed lighting is the "pop" or color mismatch between dynamic light and baked indirect light. To bridge this gap, ensure your Light Probes are correctly placed in the volume where dynamic objects move.
If your dynamic light feels "detached" from your baked background, verify your Light Mode is set to Shadowmask in the Lighting window. You can verify your light contribution using the Rendering Debugger:
// Use the Rendering Debugger to verify the Shadowmask mode
// Ensure your 'Lighting' debug view shows 'Shadowmask'
// to confirm indirect light is being blended correctly.
When setting up your scenes, always keep your Baked Indirect mode for lights that don't need to cast real-time shadows, reserving the Shadowmask mode only for those crucial dynamic lights (like a moving sun or flashlight) to keep your frame budget intact.
Key Takeaway: Use Shadowmask mode to maintain performance by baking indirect light into lightmaps while allowing dynamic objects to cast high-fidelity shadows that integrate seamlessly with the static environment.