MotionScript

@motion-script/core


@motion-script/core / normalizeUniforms

Function: normalizeUniforms()

normalizeUniforms(input): SkSLUniformRecord

Defined in: attributes/shape/sksl-uniforms.ts:153

Normalise either authoring shape to a canonical record.

Accepts the record form and the sksl effect's [{name, value}] array, so one shader source can be moved between an effect and a fill without rewriting its call sites. Keys are sorted, which makes the resolved fill canonical: two authors writing the same uniforms in a different order produce the same object, so equals and any structural diff agree with the renderer (which reads by name and never sees the order at all).

Parameters

input

SkSLUniformRecord | readonly SkSLUniform[] | undefined

Returns

SkSLUniformRecord