LerpworksAcademy
On this page

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.

Further in the article

  1. The problem: a pixel sees only itself
  2. Which way the reflection points
  3. Cubemap: the whole world around a point
  4. Roughness blurs the reflection
  5. Fresnel decides how much reflection you see
  6. Screen space reflections: the answer is in the finished frame
  7. Planar reflections: a second frame
  8. Rays and Lumen
  9. When there is no answer
  10. Where it breaks
  11. Connections: the same idea in other fields
  12. Key points
  13. Test yourself