Home Reference Source
import {ToneMappingEffect} from 'postprocessing'
public class | source

ToneMappingEffect

Extends:

three~EventDispatcherEffect → ToneMappingEffect

Indirect Implements:

A tone mapping effect.

Note: ToneMappingMode.REINHARD2_ADAPTIVE requires support for EXT_shader_texture_lod.

Reference: GDC2007 - Wolfgang Engel, Post-Processing Pipeline http://perso.univ-lyon1.fr/jean-claude.iehl/Public/educ/GAMA/2007/gdc07/Post-Processing_Pipeline.pdf

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructs a new tone mapping effect.

Member Summary

Public Members
public get
this get was deprecated. Use adaptiveLuminanceMaterial.adaptationRate instead.

The luminance adaptation rate.

public set
public get
this get was deprecated. Use mode instead.

Indicates whether this pass uses adaptive luminance.

public set
public get

The adaptive luminance material.

public get

The average luminance.

public set
public get
this get was deprecated.
public set
public get

The middle grey factor.

public set
public get

The tone mapping mode.

public set
public get

The resolution of the luminance texture.

public set
public get

The white point.

public set

Method Summary

Public Methods
public
this method was deprecated. Use adaptiveLuminanceMaterial instead.

Returns the adaptive luminance material.

public
this method was deprecated. Use mode instead.

Returns the current tone mapping mode.

public
this method was deprecated. Use resolution instead.

Returns the resolution of the luminance texture.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public
this method was deprecated. Use mode instead.

Sets the tone mapping mode.

public
this method was deprecated. Use resolution instead.

Sets the resolution of the luminance texture.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect.

Inherited Summary

From class Effect
public get

inputColorSpace: ColorSpace

this get is experimental.

The input color space.

public set

mainCamera: Camera

Sets the main camera.

public set

mainScene: Scene

Sets the main scene.

public get

outputColorSpace: ColorSpace

this get is experimental.

The output color space.

protected set

inputColorSpace: ColorSpace

this set is experimental.
protected set

outputColorSpace: ColorSpace

this set is experimental.
public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

WebGL extensions that are required by this effect.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

public

Performs a shallow search for properties that define a dispose method and deletes them.

public

Returns the effect attributes.

public
this method was deprecated. Use blendMode instead.

Returns the blend mode.

public
this method was deprecated. Use defines instead.

Returns the preprocessor macro definitions.

public
this method was deprecated. Use extensions instead.

Returns the WebGL extensions that are required by this effect.

public

Returns the fragment shader.

public
this method was deprecated. Use name instead.

Returns the name of this effect.

public

getUniforms(): Map<String, Uniform>

this method was deprecated. Use uniforms instead.

Returns the uniforms of this effect.

public

Returns the vertex shader.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategies)

Sets the depth texture.

public

setRenderer(renderer: WebGLRenderer)

this method was deprecated.

Sets the renderer.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect by performing supporting operations.

protected

Sets the effect attributes.

protected

Informs the associated EffectPass that this effect requires a shader recompilation.

protected

setFragmentShader(fragmentShader: String)

Sets the fragment shader.

protected

setVertexShader(vertexShader: String)

Sets the vertex shader.

Public Constructors

public constructor(options: Object) source

Constructs a new tone mapping effect.

The additional parameters only affect the Reinhard2 operator.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options.

options.blendFunction BlendFunction
  • optional
  • default: BlendFunction.SRC

The blend function of this effect.

options.adaptive Boolean
  • optional
  • default: false

Deprecated. Use mode instead.

options.mode ToneMappingMode
  • optional
  • default: ToneMappingMode.AGX

The tone mapping mode.

options.resolution Number
  • optional
  • default: 256

The resolution of the luminance texture. Must be a power of two.

options.maxLuminance Number
  • optional
  • default: 4.0

Deprecated. Same as whitePoint.

options.whitePoint Number
  • optional
  • default: 4.0

The white point.

options.middleGrey Number
  • optional
  • default: 0.6

The middle grey factor.

options.minLuminance Number
  • optional
  • default: 0.01

The minimum luminance. Prevents very high exposure in dark scenes.

options.averageLuminance Number
  • optional
  • default: 1.0

The average luminance. Used for the non-adaptive Reinhard operator.

options.adaptationRate Number
  • optional
  • default: 1.0

The luminance adaptation rate.

Public Members

public get adaptationRate: Number source

this get was deprecated. Use adaptiveLuminanceMaterial.adaptationRate instead.

The luminance adaptation rate.

public set adaptationRate source

public get adaptive: Boolean source

this get was deprecated. Use mode instead.

Indicates whether this pass uses adaptive luminance.

public set adaptive source

public get adaptiveLuminanceMaterial: AdaptiveLuminanceMaterial source

The adaptive luminance material.

public get averageLuminance: Number source

The average luminance.

Only applies to Reinhard2 (Modified).

public set averageLuminance source

public get distinction: Number source

this get was deprecated.

public set distinction source

public get middleGrey: Number source

The middle grey factor. Default is 0.6.

Only applies to Reinhard2 (Modified & Adaptive).

public set middleGrey source

public get mode: ToneMappingMode source

The tone mapping mode.

public set mode source

public get resolution: Number source

The resolution of the luminance texture. Must be a power of two.

public set resolution source

public get whitePoint: Number source

The white point. Default is 4.0.

Only applies to Reinhard2 (Modified & Adaptive).

public set whitePoint source

Public Methods

public getAdaptiveLuminanceMaterial(): AdaptiveLuminanceMaterial source

this method was deprecated. Use adaptiveLuminanceMaterial instead.

Returns the adaptive luminance material.

Return:

AdaptiveLuminanceMaterial

The material.

public getMode(): ToneMappingMode source

this method was deprecated. Use mode instead.

Returns the current tone mapping mode.

Return:

ToneMappingMode

The tone mapping mode.

public getResolution(): Number source

this method was deprecated. Use resolution instead.

Returns the resolution of the luminance texture.

Return:

Number

The resolution.

public initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) source

Performs initialization tasks.

Override:

Effect#initialize

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

alpha Boolean

Whether the renderer uses the alpha channel or not.

frameBufferType Number

The type of the main frame buffers.

public setMode(value: ToneMappingMode) source

this method was deprecated. Use mode instead.

Sets the tone mapping mode.

Params:

NameTypeAttributeDescription
value ToneMappingMode

The tone mapping mode.

public setResolution(value: Number) source

this method was deprecated. Use resolution instead.

Sets the resolution of the luminance texture. Must be a power of two.

Params:

NameTypeAttributeDescription
value Number

The resolution.

public update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number) source

Updates this effect.

Override:

Effect#update

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

A frame buffer that contains the result of the previous pass.

deltaTime Number
  • optional

The time between the last frame and the current one in seconds.