length
The length of a vector.
length(v: Val): Expr
Import math from shaders/std and use math.length.
The distance from the origin, or from a center when you pass the offset from it.
Parameters
| Name | Type | Notes |
|---|---|---|
v | Val |
Example
const dist = length(sub(uv, params.uniforms.center))