motionBlur

Smears the child along a path: a straight streak, an arc around a point, or a zoom out of a point.

motionBlur(opts: {path: BlurPathSpec; amount: ArgSpec; detail?: MotionBlurDetailSlots}): GatherEffect

Import effects from shaders/std and use effects.blurs.motionBlur.

amount is a 0–100 intensity. A linear streak spans about twice amount in pixels; at 100 an orbit sweeps about 29 degrees and a zoom pulls in from twice the distance to its center. detail adds the lens dials (dispersion, falloff, focus) and streak dials (bias, highlights, jitter, and spiral for a zoom); all are off at 0 and cost nothing until one is set.

Parameters

NameTypeNotes
opts{path: BlurPathSpec; amount: ArgSpec; detail?: MotionBlurDetailSlots}

Examples

effect: motionBlur({path: blurPath.linear(p('angle')), amount: p('intensity')})
effect: motionBlur({path: blurPath.zoom(p('center')), amount: p('intensity'), detail: {dispersion: p('dispersion'), falloff: p('falloff'), focus: p('focus'), bias: p('bias'), highlights: p('highlights'), jitter: p('jitter'), spiral: p('spiral')}})

Tip. Samples past the canvas edge repeat the border color. Wrap the layer in a larger group if the smear must fade out instead.

Tip. Give every detail prop recompile: crosses(0); the detail gather is only compiled while one of them is non-zero.

See also

  • blurPath — The three paths motionBlur can smear along.
  • gaussianBlur — A soft, even blur of the child.
  • scatter — Scatters every pixel of the child by a random offset: a grainy diffusion, not a smooth blur.

Used by

AngularBlur, LinearBlur, ZoomBlur