toneMapping
Maps High Dynamic Range (HDR) colors to the Low Dynamic Range (LDR) display space to prevent highlight clipping and preserve scene details, a key step for achieving photorealism.
Core Advantages
Unlike the global renderer-level setting, it can be applied locally within a shader, offering independent tone mapping control for specific objects or intermediate post-processing steps, which provides exceptional flexibility.
Common Uses
As a standard HDR post-processing step before final output
Preprocessing images before effects like Bloom to control the range and intensity of the glow
Independently processing HDR textures within a material for correct display on a model's surface
How to adjust
Change the visual style and color by switching the `mapping` algorithm (e.g., ACESFilmic), and control the overall brightness of the image by adjusting the `exposure` input value.
Code Examples
1const toneMappedColor = toneMapping(
2 THREE.ACESFilmicToneMapping, // The filmic tone mapping algorithm
3 renderer.toneMappingExposure, // The exposure level
4 viewportTexture // The input HDR color
5);