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
| Name | Type | Notes |
|---|---|---|
x | Val |
Example
const side = sign(sub(uv.member('x'), 0.5))
See also
abs— The value without its sign.
−1, 0 or 1 by the sign of the value.
sign(x: Val): Expr
Import math from shaders/std and use math.sign.
| Name | Type | Notes |
|---|---|---|
x | Val |
const side = sign(sub(uv.member('x'), 0.5))
abs — The value without its sign.