Open any 3D game, pause on a bright scene, and look at the shadows. Every one of them â the sharp silhouette of a building, the soft penumbra under a tree â was calculated in a fraction of a millisecond by the same elegant trick invented by Lance Williams in 1978: shadow mapping.
The core idea is almost childishly simple. Before drawing the scene for your eye, the GPU draws it once more, pretending to be the light. From that vantage point it records only how far away each surface is â a depth value per pixel called the shadow map. Then, when drawing the scene for real, it asks for every visible point: was the light closer than that depth value, or farther? Closer means lit; farther means something blocked the light â shadow.
That depth-comparison is per pixel â a single texture lookup and one numerical test. Yet from this nearly trivial operation emerges the convincing shadows that make 3D graphics feel three-dimensional. Understanding shadow mapping means understanding the bridge between simple geometry and believable light.
Comments
Loading comments...