sign

−1, 0 or 1 by the sign of the value.

sign(x: Val): Expr

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

Parameters

NameTypeNotes
xVal

Example

const side = sign(sub(uv.member('x'), 0.5))

See also

  • abs — The value without its sign.