Free, in your browser

Explore tonemapping

Light brighter than the screen can show, through the usual operators: see each on a bright scene and as a curve, then copy its Metal.

Eight bands, each twice as bright as the last (from 1/16 to 8), and a sun at 60, through the operator.

Open in the playground

What tonemapping is

Light in a scene has no top: a sun is thousands of times brighter than a wall. A screen shows 0 to 1. A tonemap operator is the curve that squeezes the one onto the other: it keeps the dark end nearly as it is, and bends the bright end so it rolls off instead of clipping. Exposure scales the scene first; the white point is the scene value that becomes pure white, where the operator has one.

In a shader

Work in linear light, add all your lights, then tonemap, then the gamma step last of all; the whole shader does it in that order. The curves are read from the very Metal shown, so what you copy is what you saw.