Skip to content

Documentation / scene / GaussianBlurBlitter

Class: GaussianBlurBlitter ​

Defined in: libs/scene/src/blitter/gaussianblur.ts:17

Gaussian blur blitter

Extends ​

Constructors ​

Constructor ​

new GaussianBlurBlitter(phase, kernalSize, sigma, blurSize): GaussianBlurBlitter

Defined in: libs/scene/src/blitter/gaussianblur.ts:41

Creates an instance of GaussianBlurBlitter

Parameters ​

phase ​

"vertical" | "horizonal"

Blitter phase

kernalSize ​

number

kernel size

sigma ​

number

Gaussian standard deviation

blurSize ​

number

Blur radius

Returns ​

GaussianBlurBlitter

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


blurSize ​

Get Signature ​

get blurSize(): number

Defined in: libs/scene/src/blitter/gaussianblur.ts:53

Blur radius

Returns ​

number

Set Signature ​

set blurSize(val): void

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

Parameters ​
val ​

number

Returns ​

void


kernelSize ​

Get Signature ​

get kernelSize(): number

Defined in: libs/scene/src/blitter/gaussianblur.ts:60

Kernel size

Returns ​

number

Set Signature ​

set kernelSize(val): void

Defined in: libs/scene/src/blitter/gaussianblur.ts:63

Parameters ​
val ​

number

Returns ​

void


logSpace ​

Get Signature ​

get logSpace(): boolean

Defined in: libs/scene/src/blitter/gaussianblur.ts:70

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/gaussianblur.ts:73

Parameters ​
val ​

boolean

Returns ​

void


logSpaceMultiplier ​

Get Signature ​

get logSpaceMultiplier(): number

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

Multiplier for logarithmic space blur

Returns ​

number

Set Signature ​

set logSpaceMultiplier(val): void

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

Parameters ​
val ​

number

Returns ​

void


depthTexture ​

Get Signature ​

get depthTexture(): Texture2D<unknown>

Defined in: libs/scene/src/blitter/gaussianblur.ts:87

Linear depth texture

Returns ​

Texture2D<unknown>

Set Signature ​

set depthTexture(tex): void

Defined in: libs/scene/src/blitter/gaussianblur.ts:90

Parameters ​
tex ​

Texture2D<unknown>

Returns ​

void


depthCutoff ​

Get Signature ​

get depthCutoff(): number

Defined in: libs/scene/src/blitter/gaussianblur.ts:99

Depth cutoff

Returns ​

number

Set Signature ​

set depthCutoff(val): void

Defined in: libs/scene/src/blitter/gaussianblur.ts:102

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/gaussianblur.ts:109

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/gaussianblur.ts:142

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/gaussianblur.ts:157

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/gaussianblur.ts:297

Calculates the hash code

Returns ​

string

the calculated hash code

Overrides ​

Blitter.calcHash

Released under the MIT License.