smearAlong

Blurs any 2D lookup along a direction, for streaked reflections and motion smear.

smearAlong(
  opts: {center: Expr; axis: Expr; spread: Expr; taps?: number; sigma?: number; hint?: string},
  sample: (x: Expr, y: Expr) =,
> Expr): Expr

Import materials from shaders/std and use materials.smearAlong.

Samples taps points (default 9) spread spread either side of center along the unit vector axis, weighted by a bell curve, and sums them. sample receives an x and a y.

Parameters

NameTypeNotes
opts{center: Expr; axis: Expr; spread: Expr; taps?: number; sigma?: number; hint?: string}
sample(x: Expr, y: Expr) => Expr

Example

const env = smearAlong({center: R, axis: brush.tangent, spread: 0.3}, (x, y) => studioSoftboxes(x, y, studio))

See also

  • studioSoftboxes — The brightness of a five-light studio seen in a reflected direction.
  • grainNoise — One octave of smooth signed noise along and across a direction, for grain.

Used by

BrushedMetal