API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classUniformBlockData

@codexo/exojs / rendering / stable

One uniform block's values, owned by the material or filter that declared it. The block holds a single `ArrayBuffer` in the canonical layout, the typed accessors that write into it, and a revision that advances whenever a byte changes. Backends compare the revision they last uploaded against revision and skip the transfer when it has not moved, so a block whose values are set once and then left alone costs no GPU traffic per frame. Sharing a Shader across instances shares the declaration, never these values: each material or filter builds its own block.

7
props
3
methods
0
events
Import
import { UniformBlockData } from '@codexo/exojs'

One uniform block's values, owned by the material or filter that declared it.

The block holds a single `ArrayBuffer` in the canonical layout, the typed accessors that write into it, and a revision that advances whenever a byte changes. Backends compare the revision they last uploaded against revision and skip the transfer when it has not moved, so a block whose values are set once and then left alone costs no GPU traffic per frame.

Sharing a Shader across instances shares the declaration, never these values: each material or filter builds its own block.

Constructors1
onChange runs after every write that moved the revision. It exists for an owner whose result is cached elsewhere - a filter feeding a retained node - and must stay cheap: a per-component write calls it once.
Methods3
commit(): this
Declare that the raw views were written directly. Required after any write through float32, int32 or uint32: those bypass the accessors, and nothing else can observe them.
Write several fields at once, advancing revision once.
setPacked(source: ArrayBufferView): this
Replace the whole block with source, which must be exactly byteLength bytes. The copy is unconditional - the caller already holds the bytes, and comparing a whole block costs about as much as uploading it - so the revision always advances.
Properties7
float32: Float32Array
The block's bytes as a Float32Array, for advanced callers that write offsets they computed themselves. A direct write bypasses the accessors' change detection, so it must be followed by commit.
int32: Int32Array
The block's bytes as an Int32Array. See float32.
The block's layout, including field offsets and the shader-visible names.
uint32: Uint32Array
The block's bytes as a Uint32Array. See float32.
The typed accessor for each declared field, under the field's own name.
byteLength: number
Size of the block in bytes, padded to a multiple of 16.
revision: number
Advances whenever a write changed a byte. Backends use it to decide whether to upload; it is monotonic and never reused.
Source