Lighting & rendering · Intermediate
Shadow mapping
How real-time engines draw shadows fast, using a depth image from each light
What is shadow mapping?
Shadow mapping is a fast way for real-time engines to draw shadows. Each light first renders a depth image, the shadow map, recording how far it can see. When the scene is drawn, any point farther from the light than that recorded depth is in shadow.
Think of it like this
It is like a lighthouse keeper noting the nearest object in every direction. Anything behind those objects, from the keeper’s view, sits in their shadow.
Where it fits in a 3D project
- Create
- Surface
- Rig
- Animate
- Render
- Export
Render: Lighting the scene and turning it into images or video.
How shadow mapping works
- 01The engine renders the scene from the light’s point of view, storing depth only.
- 02That depth image, the shadow map, records the nearest surface in each direction.
- 03While drawing the camera view, each point is checked against the map.
- 04Points farther from the light than the stored depth are shaded as shadow.
Shadow mapping vs ray-traced shadows
| Property | Shadow mapping | Ray-traced shadows |
|---|---|---|
| Speed | Very fast | Slower |
| Edges | Can look blocky or blurry | Accurate, from sharp to soft |
| Hardware | Works everywhere | Needs ray-tracing support for real time |
| Typical use | Most games and viewports | Offline renders, high-end games |
Shadow maps are the reliable default for real-time work; ray-traced shadows are worth the cost when contact shadows and soft edges must be exact.
Where shadow mapping is used
- Shadows in video games
- Real-time viewports and previews
- Web and mobile 3D scenes
Beginner tip
If shadows flicker or float off objects, adjust the shadow bias before raising resolution. Bias controls how strictly points are compared with the map.
Terms related to shadow mapping
- Lighting & renderingRasterizationThe fast way games and viewports draw 3D, by filling in triangles on screen
- Lighting & renderingReal-time renderingDrawing 3D images fast enough to react instantly, as in games and viewports
- Lighting & renderingRay tracingRendering by following rays of light for true reflections and shadows
- Lighting & renderingLightmapA texture of baked lighting that lets real-time scenes look richly lit
- Lighting & renderingAnti-aliasingSmoothing the jagged stair-step edges in rendered images
- Lighting & renderingVolumetric lightingLight made visible in fog, dust or smoke, creating beams and haze
Shadow mapping FAQ
Updated October 29, 2026 · Browse all 3D terms