ToneMappingEffectDesc
The ToneMappingEffectDesc class is a Descriptor that applies a tone mapping effect. It performs color adjustment from HDR (High Dynamic Range) to LDR (Low Dynamic Range), converting to a range that can be displayed on screen.
Properties
Section titled “Properties”visible
Section titled “visible”Type: boolean | undefined
Description: Controls the visibility of the effect descriptor.
Default: true
Type: ToneMappingMode | undefined
Description: Specifies the tone mapping mode. Available modes include AGX, ACES_FILMIC, LINEAR, REINHARD, REINHARD2, UNREAL, and more.
Default: ToneMappingMode.AGX
Example:
{ toneMapping: { mode: ToneMappingMode.ACES_FILMIC, }}Usage Examples
Section titled “Usage Examples”Using tone mapping with default effects
Section titled “Using tone mapping with default effects”import ThreeView from "@navaramap/three";import { DefaultPlugin } from "@navaramap/three_default_plugin";
const view = new ThreeView();const plugin = new DefaultPlugin();view.addPlugin(plugin);await view.init();
// Add default photorealistic objects (includes ToneMappingEffectDesc)const defaultLayers = plugin.addDefaultPhotorealScene();
// Set exposureview.toneMappingExposure = 10;Using different tone mapping modes
Section titled “Using different tone mapping modes”import ThreeView from "@navaramap/three";import { ToneMappingEffectDesc, ToneMappingMode } from "@navaramap/three_default_descs";
const view = new ThreeView();await view.init();
// AGX mode (default, well-balanced results)view.addEffect<ToneMappingEffectDesc>({ toneMapping: { mode: ToneMappingMode.AGX, },});
// Or, ACES Filmic mode (cinematic look)view.addEffect<ToneMappingEffectDesc>({ toneMapping: { mode: ToneMappingMode.ACES_FILMIC, },});
// Reinhard modeview.addEffect<ToneMappingEffectDesc>({ toneMapping: { mode: ToneMappingMode.REINHARD, },});Usage combined with exposure adjustment
Section titled “Usage combined with exposure adjustment”import ThreeView from "@navaramap/three";import { ToneMappingMode } from "@navaramap/three_default_descs";import { DefaultPlugin } from "@navaramap/three_default_plugin";
const view = new ThreeView();const plugin = new DefaultPlugin();view.addPlugin(plugin);await view.init();
const defaultLayers = plugin.addDefaultPhotorealScene();
// Enable tone mappingdefaultLayers.toneMapping.update({ visible: true, toneMapping: { mode: ToneMappingMode.AGX, },});
// Adjust exposure (bright scene)view.toneMappingExposure = 15;
// Adjust exposure (dark scene)view.toneMappingExposure = 5;Adding a tone mapping Descriptor individually
Section titled “Adding a tone mapping Descriptor individually”import ThreeView from "@navaramap/three";import { ToneMappingEffectDesc, SMAAEffectDesc, ToneMappingMode } from "@navaramap/three_default_descs";
const view = new ThreeView();await view.init();
view.toneMappingExposure = 3;
// Add tone mapping effect descriptorview.addEffect<ToneMappingEffectDesc>({ toneMapping: { mode: ToneMappingMode.NEUTRAL, },});
// Add SMAA effect descriptor (applied after tone mapping)view.addEffect<SMAAEffectDesc>({ smaa: {},});By applying appropriate tone mapping, you can convert HDR rendering results into visually appealing images. The AGX mode is used by default and provides well-balanced results. Exposure can be adjusted with view.toneMappingExposure.