Parameters
Name | Type | Description |
---|---|---|
signedDistance | f32 | Signed distance field value. |
thickness | f32 | Stroke thickness. |
center | f32 | Center distance for the stroke. |
Returns
f32if within stroke, 0.0 if not.
WGSL Code
fn sdfToStroke(signedDistance: f32, thickness: f32, center: f32) -> f32 {return select(0.0, 1.0, abs(signedDistance - center) <= thickness * 0.5);}