heatRamp

The colors of overexposed light, from a dim fringe through a mid tone to a hot core.

heatRamp(colors: {hot: PropRef; mid: PropRef; fringe: PropRef}): { kind: "heatRamp"; taps: (heat: Expr, params: { uniforms: Record<string, Expr>; }) => Expr; }

Import light from shaders/std and use light.heatRamp.

Pass three color props. Call .taps(heat, params) on the result to turn a heat field into RGB: heat 0 is black, the fringe color shows first, the mid color by 0.5, the hot color above 1, and the light keeps getting brighter up to a heat of 1.6. Each channel reads a slightly different heat, which gives bright edges their color fringing.

Parameters

NameTypeNotes
colors{hot: PropRef; mid: PropRef; fringe: PropRef}

Example

return heatRamp({hot: p('colorHot'), mid: p('colorMid'), fringe: p('colorFringe')}).taps(heat, params)

Tip. Run the heat through dithered first on long soft ramps.

See also

  • dithered — Adds a trace of noise to a heat field so long soft ramps do not show bands.
  • screenGlow — An effect that shines emitted light onto the layer inside it, the way light hits film.

Used by

LightLeak