Home Reference Source
import {BloomEffect} from 'postprocessing/src/effects/BloomEffect.js'
public class | source

BloomEffect

Extends:

Effect → BloomEffect

Indirect Implements:

A bloom effect.

This effect uses the fast Kawase convolution technique and a luminance filter to blur bright highlights.

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructs a new bloom effect.

Member Summary

Public Members
public get

The luminance distinction factor.

public set
public get

Indicates whether dithering is enabled.

public set

Enables or disables dithering.

public get

The blur kernel size.

public set
public get

texture: Texture

A texture that contains the intermediate result of this effect.

Private Members
private

A blur pass.

private

A luminance shader pass.

private

renderTarget: WebGLRenderTarget

A render target.

private

resolution: Vector2

The original resolution.

Method Summary

Public Methods
public

Returns the current resolution scale.

public

initialize(renderer: WebGLRenderer, alpha: Boolean)

Performs initialization tasks.

public

Sets the resolution scale.

public

setSize(width: Number, height: Number)

Updates the size of internal render targets.

public

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

Updates this effect.

Inherited Summary

From class Effect
public

[key]: *

public

The effect attributes.

public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

The fragment shader.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

public

The vertex shader.

public

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

setSize(width: Number, height: Number)

Updates the size of this effect.

public

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

Updates the effect by performing supporting operations.

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.resolutionScale Number
  • optional
  • default: 0.5

The render texture resolution scale, relative to the screen render size.

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

The blur kernel size.

options.distinction Number
  • optional
  • default: 1.0

The luminance distinction factor. Raise this value to bring out the brighter elements in the scene.

Public Members

public get distinction: Number source

The luminance distinction factor.

public set distinction: Number source

public get dithering: Boolean source

Indicates whether dithering is enabled.

public set dithering: Boolean source

Enables or disables dithering.

public get kernelSize: KernelSize source

The blur kernel size.

public set kernelSize: KernelSize source

public get texture: Texture source

A texture that contains the intermediate result of this effect.

This texture will be applied to the scene colors unless the blend function is set to SKIP.

Private Members

private blurPass: BlurPass source

A blur pass.

private luminancePass: ShaderPass source

A luminance shader pass.

private renderTarget: WebGLRenderTarget source

A render target.

private resolution: Vector2 source

The original resolution.

Public Methods

public getResolutionScale(): Number source

Returns the current resolution scale.

Return:

Number

The resolution scale.

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

Performs initialization tasks.

Override:

Effect#initialize

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

alpha Boolean

Whether the renderer uses the alpha channel or not.

public setResolutionScale(scale: Number) source

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, delta: 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.

delta Number
  • optional

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