neg

The value with its sign flipped.

neg(a: Val): Expr

Import math from shaders/std and use math.neg.

Parameters

NameTypeNotes
aVal

Example

const falloff = exp(neg(mul(dist, 4)))

See also

  • sub — The first value minus the second.
  • abs — The value without its sign.

Used by

Prism, ReactionDiffusion, StudioBackground, Voxels, Waveform