Contact Shadows
Fine shadows where objects touch surfaces
Also known as: Screen-space shadows · Contact shadow Unreal · Contact shadows HDRP · Small detail shadows
Definition
Contact shadows are short, sharp shadows that appear where objects touch or come near a surface, such as under a rock, around a brick edge or in a crack. They are computed in screen space, by marching a short ray through the depth buffer from each pixel toward the light, so they capture small details that a normal shadow map misses. They only work for what the camera sees, and only over a short distance.
In production
Use them as an addition to your main shadows, with a short length that covers small details, and check them on surfaces such as grass, props on the ground and character details. In Unreal Engine, a light has a Contact Shadow Length setting, and HDRP provides contact shadows on lights. Too long a length causes dark halos and floating shadows, and they cannot show things outside the screen.
Tools that use Contact Shadows
See also
SSAO
Screen-space ambient occlusion
Ambient Occlusion
Soft contact shadows
Depth Buffer
Per-pixel distance used to sort what is visible
Cascaded Shadow Maps
Shadows with more detail near the camera
Virtual Shadow Maps
High-resolution shadows in Unreal Engine 5
Shadow Acne and Peter Panning in Unity
Striped shadows or shadows detached from objects