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

BloomEffect

Extends:

three~EventDispatcherEffect → BloomEffect

Direct Subclass:

SelectiveBloomEffect

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
this method was deprecated. Use intensity instead.

Sets the bloom intensity.

public
this method was deprecated.

Sets the resolution scale.

public

setSize(width: Number, height: Number)

Updates the size of internal render targets.

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 bloom effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options.

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

The blend function of this effect.

options.luminanceThreshold Number
  • optional
  • default: 0.9

The luminance threshold. Raise this value to mask out darker elements in the scene.

options.luminanceSmoothing Number
  • optional
  • default: 0.025

Controls the smoothness of the luminance threshold.

options.mipmapBlur Boolean
  • optional
  • default: false

Enables or disables mipmap blur.

options.intensity Number
  • optional
  • default: 1.0

The bloom intensity.

options.radius Number
  • optional
  • default: 0.85

The blur radius. Only applies to mipmap blur.

options.levels Number
  • optional
  • default: 8

The amount of MIP levels. Only applies to mipmap blur.

options.kernelSize KernelSize
  • optional
  • default: KernelSize.LARGE

Deprecated. Use mipmapBlur instead.

options.resolutionScale Number
  • optional
  • default: 0.5

Deprecated. Use mipmapBlur instead.

options.resolutionX Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use mipmapBlur instead.

options.resolutionY Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use mipmapBlur instead.

options.width Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use mipmapBlur instead.

options.height Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use mipmapBlur instead.

Public Members

public blurPass: KawaseBlurPass source

this member was deprecated. Use mipmapBlurPass instead.

A blur pass.

public get distinction: Number source

this get was deprecated.

public set distinction source

public get dithering: Boolean source

this get was deprecated. Use EffectPass.dithering instead.

Indicates whether dithering is enabled.

public set dithering source

public get height: Number source

this get was deprecated.

The current height of the internal render targets.

public set height source

public get intensity: Number source

The bloom intensity.

public set intensity source

public get kernelSize: KernelSize source

this get was deprecated.

The blur kernel size.

public set kernelSize source

public get luminanceMaterial: LuminanceMaterial source

The luminance material.

public luminancePass: LuminancePass source

A luminance pass.

Disable to skip luminance filtering.

public mipmapBlurPass: MipmapBlurPass source

A mipmap blur pass.

public get texture: Texture source

A texture that contains the intermediate result of this effect.

public get width: Number source

this get was deprecated.

The current width of the internal render targets.

public set width source

Public Methods

public getBlurPass(): KawaseBlurPass source

this method was deprecated.

Returns the blur pass.

Return:

KawaseBlurPass

The blur pass.

public getIntensity(): Number source

this method was deprecated. Use intensity instead.

The bloom intensity.

Return:

Number

The intensity.

public getLuminanceMaterial(): LuminanceMaterial source

this method was deprecated. Use luminanceMaterial instead.

Returns the luminance material.

Return:

LuminanceMaterial

The material.

public getLuminancePass(): LuminancePass source

this method was deprecated. Use luminancePass instead.

Returns the luminance pass.

Return:

LuminancePass

The luminance pass.

public getResolution(): Resolution source

this method was deprecated. Use resolution instead.

Returns the resolution settings.

Return:

Resolution

The resolution.

public getResolutionScale(): Number source

this method was deprecated.

Returns the current resolution scale.

Return:

Number

The resolution scale.

public getTexture(): Texture source

this method was deprecated. Use texture instead.

Returns the generated bloom texture.

Return:

Texture

The texture.

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 setIntensity(value: Number) source

this method was deprecated. Use intensity instead.

Sets the bloom intensity.

Params:

NameTypeAttributeDescription
value Number

The intensity.

public setResolutionScale(scale: Number) source

this method was deprecated.

Sets the resolution scale.

Params:

NameTypeAttributeDescription
scale Number

The new resolution scale.

public setSize(width: Number, height: Number) source

Updates the size of internal render targets.

Override:

Effect#setSize

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

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.