pulse

A gentle brightness pulse that follows a pattern field, hovering around 1.

pulse(field: Field, opts: {speed: number; span: number; depth: number}): Field

Import paint from shaders/std and use paint.pulse.

The result swings between 1 − depth and 1 + depth, so depth around 0.02 is subtle. speed is how fast it breathes, span how much the pattern staggers the phase. Use it as the gain in shimmered.

Parameters

NameTypeNotes
fieldField
opts{speed: number; span: number; depth: number}

Example

paint: shimmered(rampOver(threshold(pattern, {low: 0.3, high: 0.7}), stops(p('colorSpace'))), pulse(pattern, {speed: 2.5, span: 8, depth: 0.015}))

See also

  • shimmered — Multiplies a paint's color and alpha by a gain field, for a slow shimmer over a pattern.
  • flowField — A swirling, animated wave pattern from −1 to 1.

Used by

Swirl