🎮 Mastering Light Baking
An interactive guide to transforming static lighting in Unity. Learn to pre-calculate lights and shadows to optimize performance without sacrificing visual quality.
đź“‹ Table of Contents
1. Lighting Modes: The Critical Decision
Before starting to bake, it is crucial to understand what we gain and what we lose. Baking (Baked Global Illumination) pre-calculates light into textures called Lightmaps. Here we compare the three main modes in Unity.
Realtime Lighting
Calculated every frame. Full dynamic shadows. Expensive for CPU/GPU.
Baked Lighting
Static. Zero runtime cost. Realistic light bounces (GI). Does not affect moving objects.
Mixed Lighting
Hybrid. Baked static lights + real-time shadows for moving objects.
Trade-off Analysis
Comparison based on standard PC/Console projects.
2. The Light Baking Workflow
The baking process is not just pressing a button. It requires meticulous scene preparation. Follow the interactive steps below to configure your scene correctly.
3. Lightmap Math: Resolution vs. Memory
The most common mistake is using excessive resolutions. Lightmaps are heavy textures. A linear increase in Texels per Unit results in a quadratic increase in texture size and baking time.
Memory Impact (VRAM)
Estimated Time Calculator
4. Light Probes: Illuminating the Dynamic
Static objects have lightmaps. But what about the character that moves? Light Probes capture light at specific points in space (the grey dots).
Interaction: Move the mouse over the grid. Imagine the cursor is your player. Observe how nearby probes light up to transfer lighting information to the player.
- Grey Spheres: Light Probes in the scene.
- Cursor: Dynamic object (Player).
- Yellow Color: Active influence weight.
5. Common Problem Solutions
Filter by the type of visual artifact you are experiencing to see the solution.
Post a Comment