softBand
A soft band around a line, sharp on one side and long on the other.
softBand(opts: {
distance: Expr
below: {from: Expr | number; to: Expr | number}
above: {from?: Expr | number; to: Expr | number}
}): Expr
Import mask from shaders/std and use mask.softBand.
distance is the signed distance from the line: negative below it, positive above. Coverage rises from 0 to 1 as the distance crosses below.from to below.to, then falls back to 0 as it crosses above.from (default 0) to above.to. The shape under curtains, horizons and underlines.
Parameters
| Name | Type | Notes |
|---|---|---|
opts | `{ |
distance: Expr
below: {from: Expr \| number; to: Expr \| number}
above: {from?: Expr \| number; to: Expr \| number}
}` | |
Example
const curtain = mask.softBand({distance: sub(uv.member('y'), pathY), below: {from: -0.04, to: 0.015}, above: {to: height}})
See also
softDisc— A filled disc with a soft, shaped edge.crispStroke— A clean outline of a shape, or a drawn curve, of a given width.