Image for Shadow Mapping

Shadow Mapping

Shadow mapping is a computer graphics technique used to create realistic shadows in 3D scenes. It works by first capturing the scene from the light source’s perspective to determine which areas are directly illuminated. This information is stored in a special map called a shadow map. When rendering from the viewer’s perspective, the system compares each pixel’s position to the shadow map. If a pixel’s position indicates it’s blocked from the light, it appears in shadow; if not, it’s lit. This process creates dynamic, lifelike shadows that enhance the scene’s depth and realism.