Shadow bias and shadow acne
Shadow maps store depth at limited resolution, so lit surfaces can shadow themselves in stripes (acne). Bias pushes shadows away to fix it, but too much detaches them from their casters (peter-panning).
Shadow acne is a pattern of dark stripes or dots on surfaces that should be fully lit. Shadow bias is the setting that fixes it, by pushing the shadow test away from the surface. Too much bias causes peter-panning: shadows that start a short distance from their object, so it seems to float. Each engine's bias settings steer between the two.
Shadow maps in general are covered on real-time lighting and cascaded shadow maps.
#Why acne happens
A shadow map stores, for each texel, how far the nearest surface is from the light. When the scene is drawn, each pixel compares its own distance against that stored value.
Microsoft's explanation: acne "occurs when the shadow map quantizes the depth over an entire texel. When the shader compares an actual depth against this value, it is as likely to be self-shadowed as it is to be unshadowed" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps). Precision makes it worse: the stored and computed depths are so close that "precision errors cause the depth test to erroneously fail" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps).
#Why peter-panning happens
The name "derives from a children's book character whose shadow became detached", and the artefact "makes objects with missing shadows appear to be detached from and to float above the surface" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps). It "results when the depth offset used is too large" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps).
#The settings in each engine
| Engine | Settings | What the docs say |
|---|---|---|
| Godot | Bias, Normal Bias per light | Too low and "self-shadowing occurs"; too high and "shadows separate from the casters" or "appear misaligned" (Godot Engine documentation) |
| Unity | Bias, Normal Bias, Near Plane per light | Bias controls "the distance at which shadows are pushed away from the light"; Normal Bias shrinks casters "along the surface normal" (Unity Manual) |
| Unreal | Shadow Bias (and related bias settings) per light | Shadow Bias "Controls how accurate self shadowing of whole scene shadows from this light are"; 0 shows many artefacts, higher values make objects look like they float, and the API suggests about 0.5 as a balance (Unreal Engine API Reference) |
Depth bias moves the comparison along the light's direction. Normal bias moves it along the surface normal; Godot says it "can be used to fix special cases of self-shadowing when objects are perpendicular to the light" (Godot Engine documentation: 3D lights and shadows). Slope-scaled bias applies "a large bias to a polygon that is viewed edge-on to the light direction, but not applying any bias to a polygon facing the light directly" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps).
#Fixes other than bias
Tighter shadow ranges. "The more closely together the planes are, the more precise the values in the depth buffer" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps). Unity's shadow pancaking reduces "the range of the light space used when rendering the shadow map", which "leads to an increased precision in the shadow map, reducing shadow acne" (Unity Manual: Shadow troubleshooting). See cascaded shadow maps.
Geometry with backs. This fix is the environment artist's responsibility. Microsoft advises: "Narrow objects such as walls should have backs even if they are never visible. This will increase the depth disparity" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps). Without them, "Peter Panning and shadow gaps near the base of objects such as walls are more likely" (Microsoft Learn: Common Techniques to Improve Shadow Depth Maps). Unity's workaround for normal-bias light bleeding is similar: set the renderer's Cast Shadows to Two Sided, though it "can be more resource-intensive" (Unity Manual: Shadow troubleshooting).
#Related pages
real-time lighting · cascaded shadow maps · shadows and virtual shadow maps · light leaking · light and shadow · modular kits · performance and profiling
#Further reading and watching
References
- · Common Techniques to Improve Shadow Depth Maps · Microsoft Learn (Win32 / DirectX technical articles) · docs · accessed 2026-10-21
- · 3D lights and shadows · Godot Engine documentation (source) · docs · accessed 2026-10-21
- · Light component reference · Unity Manual · docs · accessed 2026-10-21
- · ULightComponent::ShadowBias · Unreal Engine API Reference (4.27) · docs · accessed 2026-10-21
- · Shadow troubleshooting · Unity Manual · docs · accessed 2026-10-21
Pages that link here
- Cascaded shadow maps Key term
Last updated 2026-10-22