sub

The first value minus the second.

sub(a: Val, b: Val): Expr

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

Parameters

NameTypeNotes
aVal
bVal

Example

const outside = sub(1, coverage) // flip a 0..1 mask

See also

  • add — The sum of two values.
  • neg — The value with its sign flipped.

Used by

Aurora, BrushedMetal, CarbonFiber, Chrome, Crystal, FlowingGradient, Frost, Goo, Heatmap, Hologram, Holographic, Irradiance, LiquidMetal, MeshGradient, Nebula, Obsidian, PixelThrow, Plastic, Prism, ReactionDiffusion, StudioBackground, Voxels, Water, Waveform