Scalar

A number built from props: what radialMask(…), motion.oscillating(…) and .times() return.

class Scalar

Import Scalar from shaders/std.

Pass it anywhere a word accepts a ScalarInput (a prop ref or a Scalar): an effect's amount, a mask's strength. Chain .times(p('intensity')) to scale it by a prop.

Example

effect: tintToward(p('color'), {amount: radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity'))})

See also

  • p — Reference one of the definition's props by name, wherever a word asks for a value.
  • resolveScalar — A Scalar or prop ref as a GPU value, for a hand-written builder.