Dynamic and Static Lighting Setup in Games
Choosing between dynamic and static lighting is one of the first technical decisions made when designing a level. This decision determines the performance budget, shadow quality, gameplay possibilities, and volume of light pipeline work. Rolling it back mid-production is expensive.
Static lighting gives better shadow and ambient quality, but doesn't respond to scene changes. Dynamic is responsive to everything, but costs more on GPU. In practice, most projects use a hybrid scheme, and properly configuring this hybrid scheme is the main technical task.
Static Lighting: Progressive Lightmapper and Its Parameters
In Unity static lighting is baked via Progressive Lightmapper (GPU or CPU). This is a path-tracing solution that calculates indirect lighting, soft shadows, and ambient occlusion for static objects, storing the result in Lightmap Textures.
Key parameters that directly affect the result:
Lightmap Resolution. Measured in texels per unit. For external surfaces the standard is 4–8 texels/unit, for hero surfaces (floors, walls in important locations) — 16–32. Higher means longer baking and more VRAM for lightmap storage. Lower means visible shadow pixelization. Typical mistake: setting the same value for the entire scene instead of controlling via Scale in Lightmap on each object.
Samples (Direct/Indirect/Environment). Direct Samples — number of samples for direct sources. 512–1024 for production, less only for quick preview baking. Indirect Samples — depth of reverberation calculation, 512–2048 depending on scene complexity. Environment Samples — affects skybox ambient quality. Undersizing Indirect Samples is the main reason for noise on ceilings and in corners.
Denoising. Unity's built-in denoiser (OptiX for Nvidia, OIDN for CPU) removes path-tracing noise. Important: denoising smooths, not improves quality. With too few samples, the denoiser blurs shadows to losing details. Rule: there should be enough samples for the noise to be fine — then the denoiser carefully removes it.
Lightmap Compression. Unity compresses lightmaps in BC6H (HDR) by default. If a scene requires accurate color data in lighting — for example, colored light leaking through windows — BC6H is the right choice. For simple outdoor without color sources can reduce to BC4 for VRAM savings.
Dynamic Lighting: Shadow Cascades and Performance
Dynamic shadows are shadow map rendering: the scene is rendered from the light source's point of view into a depth texture, which is then used in the main render to determine shadowed zones.
Shadow Cascades are critical parameter for Directional Light (sun, moon). One shadow map for the entire scene means compromise: either fine but covering, or detailed but only for near zone. Cascaded Shadow Maps divide distance into 2–4 zones with different shadow map resolution: near zone — high resolution, far zone — low.
Proper Cascade Distances configuration is a balance between quality and performance. If First Cascade is too large — near object shadows are blurry. If too small — a sharp transition border between cascades is visible. The transition is smoothed via Shadow Cascade Blend in Unity or Dynamic Shadow Distance Fadeout in Unreal.
In Unreal Engine 5 with Lumen, dynamic global illumination is computed in Screen Space + Signed Distance Fields, which dramatically changes the lighting approach. Shadow Cascades for Directional Light remain (Virtual Shadow Maps in UE5 are significant quality improvement with controlled budget), but indirect lighting from Lumen doesn't require Light Probes and Lightmaps — this is real-time GI.
Light Probes and Mixed Lighting
Light Probes in Unity are spherical harmonics (Spherical Harmonics, L2), storing ambient lighting for a specific point in space. Dynamic objects (characters, particles, vehicles) can't use lightmaps — they take lighting from Light Probes.
A mistake found on almost every project: Light Probes are placed too sparsely or only around the level perimeter, not in zones with different lighting. A character entering a lit street into a dark building gets the same ambient in both places — lighting doesn't change. Solution: dense Probe grid in transition zones (doorways, arches, under canopies), sparse in uniformly lit areas.
Light Probe Proxy Volume (LPPV) for large dynamic objects (vehicles, large creatures): instead of one Probe at the object's center, LPPV builds a volumetric grid of Probes along object bounds. The difference is noticeable: without LPPV a large truck is lit uniformly, with LPPV the right side is darker if it's in building shadow.
Enlighten is Unity's real-time GI system (available in HDRP). Calculates reverberation from dynamically changing Directional Light — day/night cycle with Enlighten means ambient changes with sun position without relighting maps. Costs CPU time on each source change, so used selectively: only for Directional Light, other sources are static or baked.
Hybrid Scheme: What to Bake, What to Keep Dynamic
Practical scheme for most projects:
- Directional Light (sun) — Mixed mode: static shadows in lightmap, dynamic shadows for characters via Cascades
- Large Point Lights (streetlights, bonfires) — Baked if static. Dynamic only if they turn on/off by gameplay
- Small accent lights (candles, screens) — Baked, often as Emissive in lightmap
- Light Probes — place manually by zones, don't rely on Auto Generate
| Task Scale | Estimated Timeline |
|---|---|
| Lighting setup for one small location | 2–4 days |
| Interior with full GI and baked lightmaps | 4–8 days |
| Open-world level with day/night cycle | 2–4 weeks |
| Optimization and fixing existing lighting | by agreement |
We start with a technical audit: platform, target framerate, pipeline (URP/HDRP/Lumen). Next — lighting scheme design, light source placement, shadow cascades setup, lightmap baking and checking on target hardware.
Cost is calculated individually after analyzing project requirements.





