softDisc

A filled disc with a soft, shaped edge.

softDisc(opts: {
    dist: Expr
    radius: Expr | number
    softness: {width: Expr | number; curve: Expr | number}
}): Expr

Import mask from shaders/std and use mask.softDisc.

dist is the distance from the disc's center and radius its size, both in the same units. The edge fades over softness.width either side of the radius, and softness.curve bends that fade: 1 is even, higher values pull it tighter toward the rim. The look of blobs, orbs and glow dots.

Parameters

NameTypeNotes
opts`{
dist: Expr
radius: Expr \| number
softness: {width: Expr \| number; curve: Expr \| number}

}` | |

Example

const orb = mask.softDisc({dist, radius: params.uniforms.size, softness: {width: 0.08, curve: 1.5}})

See also

  • crispFill — A clean fill of a shape: 1 inside, 0 outside.
  • softBand — A soft band around a line, sharp on one side and long on the other.

Used by

Blob