Graphics › Light
Reflections: cubemaps, SSR and Lumen
Know first: Surface properties: roughness, metallic, AO, Direct and indirect light, Depth buffer: what is closer to the camera
A puddle shows the sky and a street lamp. A chrome kettle shows the whole kitchen. To draw that, the puddle’s pixel has to know what lies in the direction its reflection points, yet a shader sees only its own point. This lesson shows how the engine finds that direction. It then compares four ways of answering: cubemaps, screen space reflections, a second frame and rays. Each has holes of its own, and the lesson ends with what to do when no method has an answer. This is the eighth lesson of the course “How an engine draws a frame.”
Why this matters
The lesson on surface properties showed that every material reflects, and that a metal is made of nothing but reflection. But where does the engine get the picture that is reflected? Without an answer, a few things stay puzzling:
- why the reflection in a floor vanishes when you tilt the camera down;
- why the reflection of a window in a room slides around instead of staying on the wall;
- why a metal cabinet in a dark storeroom glows with the blue of the sky;
- why a real mirror is a costly rarity in games, while puddles are everywhere.