IT lexicon › Programming › Peter panning

Peter panning

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

The error where an object's shadow detaches from its base so the object seems to float — named after the fairy-tale boy who lost his own shadow.

The artifact is the flip side of the fight against shadow acne. To kill the self-shadowing stipple you push the stored depth-map values away from the light, but push too hard and the shadow's start slides behind whatever casts it. The contact shadow under a crate or a foot vanishes, and the object looks like it hovers a centimetre above the ground.

The name nods to J.M. Barrie's Peter Pan, whose shadow came loose and had to be sewn back on. Remedies are to keep the bias as small as possible, prefer a slope-scaled bias over a constant one, or render the shadow map from the back faces of the geometry (front-face culling) so the depth error ends up buried inside the object. Cascaded shadow maps help indirectly by giving more resolution near the camera, where the floating shows most.

← Back to the lexicon