Skip to content

Documentation / @ripl/3d / packSceneUniform

Function: packSceneUniform() ​

packSceneUniform(target, input): Float32Array

Defined in: 3d/src/core/uniforms.ts:196

Writes the scene uniform into a Float32Array laid out per SCENE_UNIFORM_FIELDS.

The counterpart to SCENE_UNIFORM_WGSL: both are derived from the same descriptors, so a field cannot be added to the bytes without appearing in the shader's struct.

Parameters ​

ParameterTypeDescription
targetFloat32ArrayThe scratch array to write into; must hold at least SCENE_UNIFORM_FLOATS.
inputSceneUniformInputThe scene state to pack.

Returns ​

Float32Array

target, for convenience.