🌑 Shadow Mapping: Seeing the Scene from the Light
How games draw shadows: render the scene’s depth from the light’s point of view, then check every pixel against it. See the shadow map itself, and the acne, jaggies and blur that come with it.
How games draw shadows: render the scene’s depth from the light’s point of view, then check every pixel against it. See the shadow map itself, and the acne, jaggies and blur that come with it.
Real light ranges from starlight to the sun, but a screen only goes from 0 to 1. See how games keep the full range, squeeze it onto the screen with tone mapping, and fake glare with bloom.
Blur, sharpen, edge detection and emboss are all the same trick: a weighted sum of neighbouring pixels. Edit a kernel live, then see why games blur in two passes instead of one.
The graphics card doesn’t have to draw to the screen. Draw into a texture instead, and you get security cameras, mirrors, shadows and every post-processing effect in modern games.