ToneMappingEffect
Extends:
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 |
setMode(value: ToneMappingMode) this method was deprecated. Use mode instead.
Sets the tone mapping mode. |
|
public |
setResolution(value: Number) this method was deprecated. Use resolution instead.
Sets the resolution of the luminance texture. |
|
public |
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 |
Shader uniforms. |
|
protected |
renderer: WebGLRenderer this member was deprecated.
The renderer. |
|
public |
dispose() 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 |
getDefines(): Map<String, String> 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 |
Updates the size of this effect. |
|
public |
Updates this effect by performing supporting operations. |
|
protected |
setAttributes(attributes: EffectAttribute) 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#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options. |
options.blendFunction | BlendFunction |
|
The blend function of this effect. |
options.adaptive | Boolean |
|
Deprecated. Use mode instead. |
options.mode | ToneMappingMode |
|
The tone mapping mode. |
options.resolution | Number |
|
The resolution of the luminance texture. Must be a power of two. |
options.maxLuminance | Number |
|
Deprecated. Same as whitePoint. |
options.whitePoint | Number |
|
The white point. |
options.middleGrey | Number |
|
The middle grey factor. |
options.minLuminance | Number |
|
The minimum luminance. Prevents very high exposure in dark scenes. |
options.averageLuminance | Number |
|
The average luminance. Used for the non-adaptive Reinhard operator. |
options.adaptationRate | Number |
|
The luminance adaptation rate. |
Public Members
public get adaptationRate: Number source
The luminance adaptation rate.
public set adaptationRate source
public get adaptive: Boolean source
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 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 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
Returns the adaptive luminance material.
public getMode(): ToneMappingMode source
Returns the current tone mapping mode.
public getResolution(): Number source
Returns the resolution of the luminance texture.
public initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) source
Performs initialization tasks.
Override:
Effect#initializepublic setMode(value: ToneMappingMode) source
Sets the tone mapping mode.
Params:
Name | Type | Attribute | Description |
value | ToneMappingMode | The tone mapping mode. |
public setResolution(value: Number) source
Sets the resolution of the luminance texture. Must be a power of two.
Params:
Name | Type | Attribute | Description |
value | Number | The resolution. |
public update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number) source
Updates this effect.
Override:
Effect#updateParams:
Name | Type | Attribute | Description |
renderer | WebGLRenderer | The renderer. |
|
inputBuffer | WebGLRenderTarget | A frame buffer that contains the result of the previous pass. |
|
deltaTime | Number |
|
The time between the last frame and the current one in seconds. |