class · blotter.ts
UniformInterface
The live handle for one uniform: a type, a validated value, and an update event its owner listens to.
extends Emitter<{ update: [] }>
import { UniformInterface } from "blotter.ts"; Every entry in material.uniforms and scope.material.uniforms is one of these. You do not construct them; Blotter builds them from the descriptors you pass to a material. Writing to value is validated against the type (a "2f" uniform wants a two-number array) and forwarded to the shader on the next frame.
material.uniforms.uSpeed.value = 2; // "1f"
material.uniforms.uCenter.value = [0.5, 0.5]; // "2f" Members #
constructor constructor
Internal. Instances are created from UniformDescriptors by the material that owns them.
type property
The GLSL vector size as a UniformType: "1f", "2f", "3f" or "4f". Fixed for the life of the uniform.
value get / set
The current value, shaped by type: a number for "1f", a tuple otherwise. Assigning validates, stores, and emits update; an invalid value throws.
toDescriptor method
The uniform as a plain { type, value } object, suitable for passing to another material.