<sk-wgsl-f32-array-uniform>

← prev index next →

Feeds a whole array of f32 values into your custom WGSL shader under one name — the way to hand shader code a table of numbers (per-band weights, a small LUT, a set of coefficients) indexable at runtime.

Remarks

This is the array member of the shader-input family that belongs to the compute & custom-WGSL concept (AbstractComputeNode), and like ColorStop it is itself a SkenraAnimatable. Its values are packed densely into the host's GPU block and are animatable element-wise at runtime, set imperatively or driven by a nested <sk-animation>; each change repacks the slot with no shader rebuild.

Key attributes. name is the non-animatable WGSL identifier (unique per host). values is a JSON array of finite numbers, animatable element-wise (all keyframes must share the array's length). The array length is structural — it must not change during an animation, and editing it re-keys the host's shader like adding or removing a member. The host generates an indexed skUniform_<name>(i: u32) -> f32 accessor, so the shader reads any element by index.

Related. It is a child of any custom-WGSL host — sk-custom-wgsl-color-source, sk-custom-wgsl-points-source, sk-custom-wgsl-point-constraint, sk-custom-wgsl-spline-source, or sk-compute-node. For a single value use sk-wgsl-uniform; for fixed-width vectors use sk-wgsl-vec2-uniform, sk-wgsl-vec3-uniform, and sk-wgsl-vec4-uniform; for a colour authored as a string use sk-wgsl-color-uniform.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
namerequired <string> "" Gets the WGSL identifier this member is addressed by.
valuesrequiredanimatable <number-list> (<number>[,<number>]*) [] Gets the array values, returning the animated array when animating.