Skip to main content

Class: UniformBlock<TUniforms>

Defined in: modules/core/src/portable/uniform-block.ts:18

A uniform block holds values of the of uniform values for one uniform block / buffer. It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.

Type Parameters​

TUniforms​

TUniforms extends Record<string, UniformValue> = Record<string, UniformValue>

Constructors​

Constructor​

new UniformBlock<TUniforms>(props?): UniformBlock<TUniforms>

Defined in: modules/core/src/portable/uniform-block.ts:30

Parameters​

props?​
name?​

string

shaderLayout?​

ShaderLayout

uniformTypes?​

Record<keyof TUniforms, Record<string, VariableShaderType>>

Returns​

UniformBlock<TUniforms>

Properties​

bindingLayout​

readonly bindingLayout: Record<string, UniformInfo> = {}

Defined in: modules/core/src/portable/uniform-block.ts:27


modified​

modified: boolean = true

Defined in: modules/core/src/portable/uniform-block.ts:25


modifiedUniforms​

modifiedUniforms: Record<keyof TUniforms, boolean>

Defined in: modules/core/src/portable/uniform-block.ts:24


name​

name: string

Defined in: modules/core/src/portable/uniform-block.ts:21


needsRedraw​

needsRedraw: string | false = 'initialized'

Defined in: modules/core/src/portable/uniform-block.ts:28


uniforms​

uniforms: Record<keyof TUniforms, UniformValue>

Defined in: modules/core/src/portable/uniform-block.ts:23

Methods​

getAllUniforms()​

getAllUniforms(): Record<string, UniformValue>

Defined in: modules/core/src/portable/uniform-block.ts:68

Returns all uniforms

Returns​

Record<string, UniformValue>


setNeedsRedraw()​

setNeedsRedraw(reason): void

Defined in: modules/core/src/portable/uniform-block.ts:63

Parameters​

reason​

string

Returns​

void


setUniforms()​

setUniforms(uniforms): void

Defined in: modules/core/src/portable/uniform-block.ts:54

Set a map of uniforms

Parameters​

uniforms​

Partial<TUniforms>

Returns​

void