resolveScalar

A Scalar or prop ref as a GPU value, for a hand-written builder.

resolveScalar(input: Scalar | ScalarSource, params: SlotParams): Expr

Import resolveScalar from shaders/std.

Products (.times()), radial masks and signals are built out here. A radial mask needs a paint: or effect: host; it throws in a warp's map:.

Parameters

NameTypeNotes
inputScalar | ScalarSource
paramsSlotParams

Example

const amount = resolveScalar(radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity')), params)

See also

  • uniformOf — The live GPU value of a prop, for a hand-written builder: uniformOf(p('radius'), params).
  • resolveArg — Any input value a word accepts (a prop ref, a Scalar, a context token, a number) as a GPU value inside a filter's builder.
  • Scalar — A number built from props: what radialMask(…), motion.oscillating(…) and .times() return.

Used by

Blob