Skip to content

Documentation / scene / BoxFilterBlitter

Class: BoxFilterBlitter

Defined in: libs/scene/src/blitter/box.ts:9

Box-filter blitter

Extends

Constructors

Constructor

new BoxFilterBlitter(phase, kernelSize, blurSize): BoxFilterBlitter

Defined in: libs/scene/src/blitter/box.ts:26

Creates an instance of BoxFilterBlitter

Parameters

phase

"horizonal" | "vertical"

phase of the blit operation

kernelSize

number

kernel size

blurSize

number

blur size

Returns

BoxFilterBlitter

Overrides

Blitter.constructor

Accessors

viewport

Get Signature

get viewport(): number[]

Defined in: libs/scene/src/blitter/blitter.ts:66

Viewport

Returns

number[]

Set Signature

set viewport(val): void

Defined in: libs/scene/src/blitter/blitter.ts:69

Parameters
val

number[]

Returns

void

Inherited from

Blitter.viewport


scissor

Get Signature

get scissor(): number[]

Defined in: libs/scene/src/blitter/blitter.ts:73

Scissor rect

Returns

number[]

Set Signature

set scissor(val): void

Defined in: libs/scene/src/blitter/blitter.ts:76

Parameters
val

number[]

Returns

void

Inherited from

Blitter.scissor


destRect

Get Signature

get destRect(): number[]

Defined in: libs/scene/src/blitter/blitter.ts:80

Destination rectangle

Returns

number[]

Set Signature

set destRect(val): void

Defined in: libs/scene/src/blitter/blitter.ts:83

Parameters
val

number[]

Returns

void

Inherited from

Blitter.destRect


srgbOut

Get Signature

get srgbOut(): boolean

Defined in: libs/scene/src/blitter/blitter.ts:92

Whether output color value in gamma color space

Returns

boolean

Set Signature

set srgbOut(val): void

Defined in: libs/scene/src/blitter/blitter.ts:95

Parameters
val

boolean

Returns

void

Inherited from

Blitter.srgbOut


renderStates

Get Signature

get renderStates(): RenderStateSet

Defined in: libs/scene/src/blitter/blitter.ts:104

Render states used to do the blitting

Returns

RenderStateSet

Set Signature

set renderStates(rs): void

Defined in: libs/scene/src/blitter/blitter.ts:107

Parameters
rs

RenderStateSet

Returns

void

Inherited from

Blitter.renderStates


hash

Get Signature

get hash(): string

Defined in: libs/scene/src/blitter/blitter.ts:113

Program hash code

Returns

string

Inherited from

Blitter.hash


logSpace

Get Signature

get logSpace(): boolean

Defined in: libs/scene/src/blitter/box.ts:37

true if the box filter will be applied in logarithmic space

Returns

boolean

Set Signature

set logSpace(val): void

Defined in: libs/scene/src/blitter/box.ts:40

Parameters
val

boolean

Returns

void


logSpaceMultiplier

Get Signature

get logSpaceMultiplier(): number

Defined in: libs/scene/src/blitter/box.ts:46

Multiplier for logarithmic space blur

Returns

number

Set Signature

set logSpaceMultiplier(val): void

Defined in: libs/scene/src/blitter/box.ts:49

Parameters
val

number

Returns

void

Methods

invalidateHash()

invalidateHash(): void

Defined in: libs/scene/src/blitter/blitter.ts:124

Force the hash code to be regenerated

Returns

void

Inherited from

Blitter.invalidateHash


readTexel()

readTexel(scope, type, srcTex, uv, srcLayer, sampleType): PBShaderExp

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

Reads a texel from the source texture

Parameters

scope

PBInsideFunctionScope

The shader scope

type

BlitType

The blit type

srcTex

PBShaderExp

The source texture

uv

PBShaderExp

The texture coordinate from where the texel will be read

srcLayer

PBShaderExp

The layer of the source texture

sampleType

"float" | "depth" | "uint" | "int"

Returns

PBShaderExp

The read texel

Inherited from

Blitter.readTexel


writeTexel()

writeTexel(scope, type, uv, texel): PBShaderExp

Defined in: libs/scene/src/blitter/blitter.ts:183

Writes a texel to destination texture

Parameters

scope

PBInsideFunctionScope

The shader scope

type

BlitType

The blit type

uv

PBShaderExp

The texture coordinate to where the texel will be written

texel

PBShaderExp

The texel to be written

Returns

PBShaderExp

The written texel

Inherited from

Blitter.writeTexel


blit()

Call Signature

blit(source, dest, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:321

Blits a 2D texture to a frame buffer

Parameters
source

Texture2D

The source texture

dest

FrameBuffer<unknown>

The frame buffer to blit onto

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:328

Blits a 2D texture to 2D texture or frame buffer

Parameters
source

Texture2D

The source texture

dest

Texture2D

The destination texture or frame buffer

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, layer, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:336

Blits a 2D texture to given layer of a 2D array texture

Parameters
source

Texture2D

The source texture

dest

Texture2DArray

The destination texture

layer

number

The layer of the destination texture

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:347

Blits a 2d array texture to another 2d array texture

Parameters
source

Texture2DArray

The source texture

dest

Texture2DArray

The destination texture

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Remarks

All layers of the source texture will be copied to the destination texture

Inherited from

Blitter.blit

Call Signature

blit(source, dest, layer, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:355

Blits given layer of a 2d array texture to a frame buffer

Parameters
source

Texture2DArray

The source texture

dest

FrameBuffer<unknown>

The frame buffer to blit onto

layer

number

The layer to be copied

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, layer, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:368

Blits given layer of a 2d array texture to a 2d texture or frame buffer

Parameters
source

Texture2DArray

The source texture

dest

Texture2D

The destination texture or frame buffer

layer

number

The layer to be copied

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:379

Blits a cube texture to another cube texture

Parameters
source

TextureCube

The source texture

dest

TextureCube

The destination texture

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Remarks

All faces of the source texture will be copied to the destination texture

Inherited from

Blitter.blit

Call Signature

blit(source, dest, face, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:387

Blits given face of a cube texture to a frame buffer

Parameters
source

TextureCube

The source texture

dest

FrameBuffer<unknown>

The frame buffer to blit onto

face

number

The face to be copied

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, face, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:400

Blits given face of a cube texture to a 2d texture or frame buffer

Parameters
source

TextureCube

The source texture

dest

Texture2D

The destination texture or frame buffer

face

number

The face to be copied

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit

Call Signature

blit(source, dest, layer?, sampler?): void

Defined in: libs/scene/src/blitter/blitter.ts:401

Blits a 2D texture to a frame buffer

Parameters
source

BaseTexture

The source texture

dest

FrameBuffer<unknown> | BaseTexture<unknown>

The frame buffer to blit onto

layer?

number | TextureSampler<unknown>

sampler?

TextureSampler<unknown>

Sampler for source texture

Returns

void

Inherited from

Blitter.blit


setup()

setup(scope, type): void

Defined in: libs/scene/src/blitter/box.ts:56

Initialize uniforms of the blit program

Parameters

scope

PBGlobalScope

The shader scope

type

BlitType

The blit type

Returns

void

Overrides

Blitter.setup


setUniforms()

setUniforms(bindGroup): void

Defined in: libs/scene/src/blitter/box.ts:85

Update uniforms of the bind group

Parameters

bindGroup

BindGroup

Returns

void

Overrides

Blitter.setUniforms


filter()

filter(scope, type, srcTex, srcUV, srcLayer, sampleType): PBShaderExp

Defined in: libs/scene/src/blitter/box.ts:95

Calculates the destination texel by the source texel

Parameters

scope

PBInsideFunctionScope

The shader scope

type

BlitType

The blit type

srcTex

PBShaderExp

The source texel

srcUV

PBShaderExp

The texture coordinate of the source texel

srcLayer

PBShaderExp

The layer of the source texture

sampleType

"float" | "uint" | "int"

Returns

PBShaderExp

the destination texel

Overrides

Blitter.filter


calcHash()

protected calcHash(): string

Defined in: libs/scene/src/blitter/box.ts:160

Calculates the hash code

Returns

string

the calculated hash code

Overrides

Blitter.calcHash

Released under the MIT License.