Skip to content

1681-engine / postfx / BloomFilter

Class: BloomFilter ​

Defined in: src/postfx/BloomFilter.ts:43

Bright things glow: the pixels above a threshold are blurred and added back over the picture. Three passes (bright, blur, combine) on textures from Pixi's pool; costlier than the one-pass effects, so give it a filterArea or put it on the world layer only.

Extends ​

Constructors ​

Constructor ​

ts
new BloomFilter(options?): BloomFilter;

Defined in: src/postfx/BloomFilter.ts:47

Parameters ​

ParameterType
optionsBloomOptions

Returns ​

BloomFilter

Overrides ​

FxFilter.constructor

Properties ​

fxName ​

ts
readonly fxName: string;

Defined in: src/postfx/fxShader.ts:132

Inherited from ​

FxFilter.fxName

Accessors ​

blur ​

Get Signature ​

ts
get blur(): number;

Defined in: src/postfx/BloomFilter.ts:73

Returns ​

number

Set Signature ​

ts
set blur(v): void;

Defined in: src/postfx/BloomFilter.ts:76

Parameters ​
ParameterType
vnumber
Returns ​

void


intensity ​

Get Signature ​

ts
get intensity(): number;

Defined in: src/postfx/BloomFilter.ts:61

Returns ​

number

Set Signature ​

ts
set intensity(v): void;

Defined in: src/postfx/BloomFilter.ts:64

Parameters ​
ParameterType
vnumber
Returns ​

void


threshold ​

Get Signature ​

ts
get threshold(): number;

Defined in: src/postfx/BloomFilter.ts:67

Returns ​

number

Set Signature ​

ts
set threshold(v): void;

Defined in: src/postfx/BloomFilter.ts:70

Parameters ​
ParameterType
vnumber
Returns ​

void

Methods ​

apply() ​

ts
apply(
   filterManager, 
   input, 
   output, 
   clearMode
): void;

Defined in: src/postfx/BloomFilter.ts:80

Applies the filter

Parameters ​

ParameterTypeDescription
filterManagerFilterSystemThe renderer to retrieve the filter from
inputTextureThe input render target.
outputRenderSurfaceThe target to output to.
clearModebooleanShould the output be cleared before rendering to it

Returns ​

void

Overrides ​

ts
FxFilter.apply

destroy() ​

ts
destroy(): void;

Defined in: src/postfx/BloomFilter.ts:91

Use to destroy the shader when its not longer needed. It will destroy the resources and remove listeners.

Returns ​

void

Overrides ​

ts
FxFilter.destroy

get() ​

ts
get(name): number | Float32Array<ArrayBufferLike>;

Defined in: src/postfx/fxShader.ts:153

A uniform's value (a number, or the live array of a vector).

Parameters ​

ParameterType
namestring

Returns ​

number | Float32Array<ArrayBufferLike>

Inherited from ​

FxFilter.get


num() ​

ts
protected num(name): number;

Defined in: src/postfx/fxShader.ts:169

A number uniform, for the subclasses' getters.

Parameters ​

ParameterType
namestring

Returns ​

number

Inherited from ​

FxFilter.num


set() ​

ts
set(name, ...values): this;

Defined in: src/postfx/fxShader.ts:158

Sets a number uniform, or the components of a vector one.

Parameters ​

ParameterType
namestring
...valuesnumber[]

Returns ​

this

Inherited from ​

FxFilter.set

Released under the MIT License.