Skip to main content

Tone Mapping

Convert scene-linear high-dynamic-range lighting into display-ready color with an ACES-style filmic response. toneMapping compresses bright highlights, preserves source alpha, and exposes explicit controls for scene exposure and supported display luminance.

GitHub

At a Glance

PropertyValue
ExporttoneMapping
BackendsWebGPU and WebGL2
Render passesOne fullscreen color-filter pass
Recommended inputScene-linear floating-point color, such as rgba16float

Usage

import {ShaderPassRenderer} from '@luma.gl/engine';
import {createBloomShaderPassPipeline, toneMapping} from '@luma.gl/effects';

const renderer = new ShaderPassRenderer(device, {
colorFormat: 'rgba16float',
shaderPasses: [createBloomShaderPassPipeline(), toneMapping]
});

renderer.renderToScreen({
sourceTexture: hdrSceneTexture,
uniforms: {toneMapping: {exposure: 1.2, maximumLuminance: 1}}
});

Parameters

ParameterDefaultRangeDescription
exposure10 to 10Linear multiplier applied to scene color before the filmic response curve.
maximumLuminance11 to 4Maximum output luminance; values above one preserve additional highlight range on compatible HDR displays.

The implementation smoothly introduces extended highlight output as scene luminance rises. Source alpha is passed through unchanged.

Composition and Cost

Keep physically motivated lighting, adaptive exposure, temporal accumulation, and Bloom in floating-point scene color before tone mapping. Apply presentation-oriented grading and FXAA afterward when those operations should see the final display-referred image. Tone mapping adds one inexpensive fullscreen color pass and owns no persistent textures.

  • HDR Auto Exposure meters changing scene brightness on the GPU.
  • Bloom spreads highlights before the final display transform.
  • FXAA can smooth visible display-space contrast edges near presentation.