import {ToneMappingEffect} from 'postprocessing/src/effects/ToneMappingEffect.js'
ToneMappingEffect
Extends:
Indirect Implements:
A tone mapping effect that supports adaptive luminosity.
If adaptivity is enabled, this effect generates a texture that represents the luminosity of the current scene and adjusts it over time to simulate the optic nerve responding to the amount of light it is receiving.
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 |
The luminance adaptation rate. |
|
public set |
|
|
public get |
Indicates whether this pass uses adaptive luminance. |
|
public set |
Enables or disables adaptive luminance. |
|
public get |
The luminance distinction factor. |
|
public set |
|
|
public get |
The resolution of the render targets. |
|
public set |
Sets the resolution of the internal render targets. |
Method Summary
Public Methods | ||
public |
initialize(renderer: WebGLRenderer, alpha: Boolean) Performs initialization tasks. |
|
public |
Updates the size of internal render targets. |
|
public |
Updates this effect. |
Inherited Summary
From class Effect | ||
public |
The effect attributes. |
|
public |
The blend mode of this effect. |
|
public |
Preprocessor macro definitions. |
|
public |
WebGL extensions that are required by this effect. |
|
public |
The fragment shader. |
|
public |
The name of this effect. |
|
public |
Shader uniforms. |
|
public |
The vertex shader. |
|
public |
dispose() Performs a shallow search for properties that define a dispose method and deletes them. |
|
public |
initialize(renderer: WebGLRenderer, alpha: Boolean) Performs initialization tasks. |
|
public |
setDepthTexture(depthTexture: Texture, depthPacking: Number) Sets the depth texture. |
|
public |
Updates the size of this effect. |
|
public |
Updates the effect by performing supporting operations. |
Public Constructors
public constructor(options: Object) source
Constructs a new tone mapping effect.
Override:
Effect#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options. |
options.blendFunction | BlendFunction |
|
The blend function of this effect. |
options.adaptive | Boolean |
|
Whether the tone mapping should use an adaptive luminance map. |
options.resolution | Number |
|
The render texture resolution of the luminance map. |
options.distinction | Number |
|
A luminance distinction factor. |
options.middleGrey | Number |
|
The middle grey factor. |
options.maxLuminance | Number |
|
The maximum luminance. |
options.averageLuminance | Number |
|
The average luminance. |
options.adaptationRate | Number |
|
The luminance adaptation rate. |
Public Members
public set adaptive: Boolean source
Enables or disables adaptive luminance.
You'll need to call EffectPass#recompile after changing this value.
public set resolution: Number source
Sets the resolution of the internal render targets.
You'll need to call EffectPass#recompile after changing this value.
Public Methods
public initialize(renderer: WebGLRenderer, alpha: Boolean) source
Performs initialization tasks.
Override:
Effect#initializeParams:
Name | Type | Attribute | Description |
renderer | WebGLRenderer | The renderer. |
|
alpha | Boolean | Whether the renderer uses the alpha channel or not. |
public setSize(width: Number, height: Number) source
Updates the size of internal render targets.
Override:
Effect#setSizepublic 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. |