IT lexicon › Programming › Shadow bias

Shadow bias

Programming På svenska → Updated: 2026-10-26

The depth offset added before the shadow-map comparison to stop surfaces from wrongly shadowing themselves.

In shadow mapping a single depth value is looked up for the whole patch a texel covers, so sloping geometry falls partly behind its own stored depth — the result being speckled shadow acne. Shadow bias nudges the stored depth slightly away from the light before the test: a constant part plus a slope-scaled part, since steep angles need more margin than surfaces facing the light head-on.

The craft is in the dosage. Too little bias and the stipple remains; too much and the shadow detaches from the object's base in peter-panning. An alternative is normal offset, which moves the lookup point along the surface normal rather than along depth, or rendering back faces instead of front faces in the shadow pass. The trade-off is the real work, and it interacts with filtering such as PCF.

← Back to the lexicon