BloomEffect
Extends:
Direct Subclass:
Indirect Implements:
A bloom effect.
Based on an article by Fabrice Piquet: https://www.froyok.fr/blog/2021-12-ue4-custom-bloom/
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) Constructs a new bloom effect. |
Member Summary
Public Members | ||
public |
this member was deprecated. Use mipmapBlurPass instead.
A blur pass. |
|
public get |
this get was deprecated.
|
|
public set |
|
|
public get |
this get was deprecated. Use EffectPass.dithering instead.
Indicates whether dithering is enabled. |
|
public set |
|
|
public get |
this get was deprecated.
The current height of the internal render targets. |
|
public set |
|
|
public get |
The bloom intensity. |
|
public set |
|
|
public get |
this get was deprecated.
The blur kernel size. |
|
public set |
|
|
public get |
The luminance material. |
|
public |
A luminance pass. |
|
public |
A mipmap blur pass. |
|
public get |
texture: Texture A texture that contains the intermediate result of this effect. |
|
public get |
this get was deprecated.
The current width of the internal render targets. |
|
public set |
|
Method Summary
Public Methods | ||
public |
this method was deprecated.
Returns the blur pass. |
|
public |
this method was deprecated. Use intensity instead.
The bloom intensity. |
|
public |
this method was deprecated. Use luminanceMaterial instead.
Returns the luminance material. |
|
public |
this method was deprecated. Use luminancePass instead.
Returns the luminance pass. |
|
public |
this method was deprecated. Use resolution instead.
Returns the resolution settings. |
|
public |
this method was deprecated.
Returns the current resolution scale. |
|
public |
getTexture(): Texture this method was deprecated. Use texture instead.
Returns the generated bloom texture. |
|
public |
initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) Performs initialization tasks. |
|
public |
setIntensity(value: Number) this method was deprecated. Use intensity instead.
Sets the bloom intensity. |
|
public |
setResolutionScale(scale: Number) this method was deprecated.
Sets the resolution scale. |
|
public |
Updates the size of internal render targets. |
|
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 bloom effect.
Override:
Effect#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options. |
options.blendFunction | BlendFunction |
|
The blend function of this effect. |
options.luminanceThreshold | Number |
|
The luminance threshold. Raise this value to mask out darker elements in the scene. |
options.luminanceSmoothing | Number |
|
Controls the smoothness of the luminance threshold. |
options.mipmapBlur | Boolean |
|
Enables or disables mipmap blur. |
options.intensity | Number |
|
The bloom intensity. |
options.radius | Number |
|
The blur radius. Only applies to mipmap blur. |
options.levels | Number |
|
The amount of MIP levels. Only applies to mipmap blur. |
options.kernelSize | KernelSize |
|
Deprecated. Use mipmapBlur instead. |
options.resolutionScale | Number |
|
Deprecated. Use mipmapBlur instead. |
options.resolutionX | Number |
|
Deprecated. Use mipmapBlur instead. |
options.resolutionY | Number |
|
Deprecated. Use mipmapBlur instead. |
options.width | Number |
|
Deprecated. Use mipmapBlur instead. |
options.height | Number |
|
Deprecated. Use mipmapBlur instead. |
Public Members
public blurPass: KawaseBlurPass source
A blur pass.
public set distinction source
public get dithering: Boolean source
Indicates whether dithering is enabled.
public set dithering source
public get height: Number source
The current height of the internal render targets.
public set height source
public set intensity source
public set kernelSize source
public get width: Number source
The current width of the internal render targets.
public set width source
Public Methods
public getIntensity(): Number source
The bloom intensity.
public getLuminanceMaterial(): LuminanceMaterial source
Returns the luminance material.
public getLuminancePass(): LuminancePass source
Returns the luminance pass.
public getResolution(): Resolution source
Returns the resolution settings.
public getResolutionScale(): Number source
Returns the current resolution scale.
public getTexture(): Texture source
Returns the generated bloom texture.
Return:
Texture | The texture. |
public initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) source
Performs initialization tasks.
Override:
Effect#initializepublic setIntensity(value: Number) source
Sets the bloom intensity.
Params:
Name | Type | Attribute | Description |
value | Number | The intensity. |
public setResolutionScale(scale: Number) source
Sets the resolution scale.
Params:
Name | Type | Attribute | Description |
scale | Number | The new resolution scale. |
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. |