continuedField
The distance field extended past the edge of an SVG shape's texture.
continuedField(
frame: SurfaceFrame,
field: SurfaceField,
params: GpuFragmentParams,
): {sdf: Expr; outward: Expr; at: (uv: Expr) => Expr}
Import materials from shaders/std and use materials.continuedField.
An SVG field stops at its 0–1 square, so a far-reaching glow or shadow would see a plateau beyond it. Returns the extended distance here, an outward push to add to any slope taken near the border, and at(uv) for the distance anywhere. Pass an unscaled surfaceField. Flat and 3D shapes pass through unchanged.
Parameters
| Name | Type | Notes |
|---|---|---|
frame | SurfaceFrame | |
field | SurfaceField | |
params | GpuFragmentParams |
Example
const far = continuedField(frame, field, params)
See also
nearestEdge— The closest point on the shape's edge to this pixel, and the outward normal there.fieldSlope— The direction the shape's distance grows in: a 2D vector pointing outward at this pixel.