Skip to content

Documentation / scene / Bloom

Class: Bloom

Defined in: libs/scene/src/posteffect/bloom.ts:13

The bloom post effect

Extends

Constructors

Constructor

new Bloom(): Bloom

Defined in: libs/scene/src/posteffect/bloom.ts:36

Creates an instance of tonemap post effect

Returns

Bloom

Overrides

AbstractPostEffect.constructor

Properties

className

readonly static className: "Bloom"

Defined in: libs/scene/src/posteffect/bloom.ts:14


_enabled

protected _enabled: boolean

Defined in: libs/scene/src/posteffect/posteffect.ts:117

Inherited from

AbstractPostEffect._enabled


_layer

protected _layer: PostEffectLayer

Defined in: libs/scene/src/posteffect/posteffect.ts:118

Inherited from

AbstractPostEffect._layer

Accessors

disposed

Get Signature

get disposed(): boolean

Defined in: libs/base/dist/index.d.ts:6065

Returns

boolean

Inherited from

AbstractPostEffect.disposed


maxDownsampleLevel

Get Signature

get maxDownsampleLevel(): number

Defined in: libs/scene/src/posteffect/bloom.ts:48

The maximum downsample levels

Returns

number

Set Signature

set maxDownsampleLevel(val): void

Defined in: libs/scene/src/posteffect/bloom.ts:51

Parameters
val

number

Returns

void


downsampleLimit

Get Signature

get downsampleLimit(): number

Defined in: libs/scene/src/posteffect/bloom.ts:55

Downsample resolution limitation

Returns

number

Set Signature

set downsampleLimit(val): void

Defined in: libs/scene/src/posteffect/bloom.ts:58

Parameters
val

number

Returns

void


threshold

Get Signature

get threshold(): number

Defined in: libs/scene/src/posteffect/bloom.ts:62

Bloom threshold

Returns

number

Set Signature

set threshold(val): void

Defined in: libs/scene/src/posteffect/bloom.ts:65

Parameters
val

number

Returns

void


thresholdKnee

Get Signature

get thresholdKnee(): number

Defined in: libs/scene/src/posteffect/bloom.ts:69

Bloom threshold knee

Returns

number

Set Signature

set thresholdKnee(val): void

Defined in: libs/scene/src/posteffect/bloom.ts:72

Parameters
val

number

Returns

void


intensity

Get Signature

get intensity(): number

Defined in: libs/scene/src/posteffect/bloom.ts:76

Bloom intensity

Returns

number

Set Signature

set intensity(val): void

Defined in: libs/scene/src/posteffect/bloom.ts:79

Parameters
val

number

Returns

void


enabled

Get Signature

get enabled(): boolean

Defined in: libs/scene/src/posteffect/posteffect.ts:129

Whether this post effect is enabled

Returns

boolean

Set Signature

set enabled(val): void

Defined in: libs/scene/src/posteffect/posteffect.ts:132

Parameters
val

boolean

Returns

void

Inherited from

AbstractPostEffect.enabled


layer

Get Signature

get layer(): PostEffectLayer

Defined in: libs/scene/src/posteffect/posteffect.ts:136

Whether this post effect will be rendered at opaque phase

Returns

PostEffectLayer

Inherited from

AbstractPostEffect.layer

Methods

on()

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:594

IEventTarget.on

Type Parameters

K

K extends "dispose"

Parameters

type

K

listener

EventListener<{ dispose: []; }, K>

context?

unknown

Returns

void

Inherited from

AbstractPostEffect.on


once()

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:598

IEventTarget.once

Type Parameters

K

K extends "dispose"

Parameters

type

K

listener

EventListener<{ dispose: []; }, K>

context?

unknown

Returns

void

Inherited from

AbstractPostEffect.once


off()

off<K>(type, listener?, context?): void

Defined in: libs/base/dist/index.d.ts:602

IEventTarget.off

Type Parameters

K

K extends "dispose"

Parameters

type

K

listener?

EventListener<{ dispose: []; }>

context?

unknown

Returns

void

Inherited from

AbstractPostEffect.off


dispatchEvent()

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:606

IEventTarget.dispatchEvent

Type Parameters

K

K extends "dispose"

Parameters

type

K

args

...object[K]

Returns

void

Inherited from

AbstractPostEffect.dispatchEvent


dispose()

dispose(): void

Defined in: libs/base/dist/index.d.ts:6066

Returns

void

Inherited from

AbstractPostEffect.dispose


requireLinearDepthTexture()

requireLinearDepthTexture(): boolean

Defined in: libs/scene/src/posteffect/bloom.ts:83

Checks whether this post effect requires the linear depth texture

Returns

boolean

true if the linear depth texture is required.

Overrides

AbstractPostEffect.requireLinearDepthTexture


requireDepthAttachment()

requireDepthAttachment(): boolean

Defined in: libs/scene/src/posteffect/bloom.ts:87

Checks whether this post effect requires the scene depth buffer

Returns

boolean

true if the scene depth buffer is required.

Overrides

AbstractPostEffect.requireDepthAttachment


setup()

setup(s): RGHandle

Defined in: libs/scene/src/posteffect/bloom.ts:97

Declare this effect's passes on the render graph.

The default implementation wraps AbstractPostEffect.apply into a single graph pass, so effects only overriding apply() work unchanged. Multi-pass effects override this method to declare each internal step as its own pass, calling PostEffectSetupContext.createOutput inside the final pass.

Parameters

s

PostEffectSetupContext

Build-time setup context.

Returns

RGHandle

The effect's output color handle.

Overrides

AbstractPostEffect.setup


apply()

apply(ctx, inputColorTexture, _sceneDepthTexture, _srgbOutput): void

Defined in: libs/scene/src/posteffect/bloom.ts:234

Apply the post effect

Parameters

ctx

DrawContext

inputColorTexture

Texture2D

The previous scene color texture

_sceneDepthTexture

Texture2D

The linear scene depth texture

_srgbOutput

boolean

Whether the result should be gamma corrected

Returns

void

Remarks

The frame buffer of the post effect is already set when apply() is called.

Overrides

AbstractPostEffect.apply


needFlip()

needFlip(device): boolean

Defined in: libs/scene/src/posteffect/posteffect.ts:144

Check if the post effect should be rendered upside down.

Parameters

device

AbstractDevice

The device object

Returns

boolean

true if the post effect should be rendered upside down

Inherited from

AbstractPostEffect.needFlip


requireMotionVectorTexture()

requireMotionVectorTexture(_ctx): boolean

Defined in: libs/scene/src/posteffect/posteffect.ts:165

Checks whether this post effect requires the motion vector texture

Parameters

_ctx

DrawContext

Returns

boolean

true if the motion vector texture is required.

Inherited from

AbstractPostEffect.requireMotionVectorTexture


passThrough()

protected passThrough(ctx, inputColorTexture, srgbOutput, renderStates?): void

Defined in: libs/scene/src/posteffect/posteffect.ts:269

Parameters

ctx

DrawContext

Draw context

inputColorTexture

Texture2D

Input color texture

srgbOutput

boolean

Whether the result should be gamma corrected

renderStates?

RenderStateSet

Returns

void

Inherited from

AbstractPostEffect.passThrough


drawFullscreenQuad()

protected drawFullscreenQuad(renderStateSet?): void

Defined in: libs/scene/src/posteffect/posteffect.ts:288

Draws a fullscreen quad

Parameters

renderStateSet?

RenderStateSet

Render states that will be used when drawing the fullscreen quad.

Returns

void

Inherited from

AbstractPostEffect.drawFullscreenQuad


onDispose()

protected onDispose(): void

Defined in: libs/scene/src/posteffect/posteffect.ts:301

Returns

void

Inherited from

AbstractPostEffect.onDispose

Released under the MIT License.