IT lexicon › Programming › Contact shadows

Contact shadows

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

Short, sharp screen-space shadows that fill the gap where an ordinary shadow map is too low-resolution to capture where an object meets the surface beneath it.

A shadow map has finite resolution, so where a foot meets the floor or a pencil rests on a desk the shadow goes blurry or vanishes and the object looks like it is floating. Contact shadows solve exactly that last centimetre: from each pixel a short ray is marched through the depth buffer (screen-space ray marching) toward the light, darkening the pixel if the ray hits anything.

Because the technique only reads depth that is already rendered, it is cheap and completely decoupled from scene complexity — a cousin of SSAO and screen-space reflections. The downside is just as familiar: anything off-screen or occluded is not in the buffer, so the shadow can be clipped at the edge. Used to complement, not replace, shadow mapping.

← Back to the lexicon