Log inGet started
Package

tonemap.shader

Newest version

README.md

tonemap.shader

The film's tone curve, and the place the film's exposure is applied.

A post-process effect in light space: it reads the scene's linear radiance, multiplies it by exposure, bends the result through a filmic curve into 0..1, and hands that on. demo.look's LookDirector writes exposure every frame from the print's trim for that film second, so the whole exposure ramp of the film happens on this shader's input.

Why the exposure is here and not on the camera

The display stage applies its transfer after every post effect has run. A gain given to an AutoExposure component therefore lands after any shoulder a shader could put in front of it, so a two-stop print push takes every practical in the room past white before the frame is encoded — which is what made the clerestory eyes, the footlights and the dressing-room bulbs arrive as flat paper white with no hue left in them. With the gain on this shader's input, a push moves the curve along the radiance axis instead and a highlight keeps its colour.

Properties

propertywhat it does
exposureLinear gain applied before the curve. The director writes 2 ^ stops.
whiteThe fraction of the display's white the shoulder asymptotes to. Below 1 the film never reaches paper white.
desaturateHow a highlight loses colour. At 0 the whole triple is scaled by what the curve did to its luminance, so a warm source stays warm all the way up; at 1 each channel is curved alone, which is the familiar filmic bleach where red saturates first and the core goes white.
toeHow much of a toe the curve carries under the midtones. 0 is a shouldered hyperbola with no toe, which leaves a shadow where the light put it; 1 is the full ACES toe, which on a film that is nine tenths shadow takes most of the frame to nothing.

Where it sits

demo.look's chain runs bloom (10), this (20), chromatic aberration (30) and vignette (40) in light, then the grade cube (50) in display. Bloom is in front of the curve because a bloom threshold is a statement about light and there is nothing above white left to threshold once the curve has run. The cube is behind it because a colour table is authored against the code values a frame arrives at, which is what display space holds.