abs
The value without its sign.
abs(x: Val): Expr
Import math from shaders/std and use math.abs.
Turns a signed distance into a distance from the line, so a stroke covers both sides.
Parameters
| Name | Type | Notes |
|---|---|---|
x | Val |
Example
const fromLine = abs(sub(uv.member('y'), 0.5))
See also
Used by
CarbonFiber, Chrome, Crystal, FlowingGradient, Heatmap, Hologram, Nebula, Plastic, Water, Waveform