Skip to main content

Install

That writes one file: compositions/components/motion-blur.html.

Source

Usage

Paste the snippet into your composition, then call attachMotionBlur() after your GSAP tweens and before registering window.__timelines.

How it works

This is the After Effects layer Motion Blur model — temporal supersampling — synthesised inside the page, because the renderer captures one instant per frame with no shutter.
  1. Sample the trajectory — after every timeline seek, the snippet seeks the timeline (events suppressed) to one sub-frame time per window boundary, reads each target’s GSAP x/y, then restores the frame time. The window is shutterAngle / 360 / fps seconds long and starts shutterPhase / 360 / fps seconds from the frame time; samplesPerFrame divides it into that many sub-intervals, so there are samplesPerFrame + 1 samples and both ends of the window carry one.
  2. Add the duplicates — each target gets an SVG filter that stacks one feOffset copy of the element per sample at its sampled position and adds them at equal weight (feComposite arithmetic, 1/N each, sRGB). A solid translating at speed v becomes a box smear of length v × shutterTime, centred on its instantaneous position — no one-sided trail and no Gaussian halo. No single duplicate exceeds 1/N, so the tails step down evenly; where the element travels less than its own size the copies overlap past 1 and clamp, leaving the middle solid rather than a plateau.
  3. Composite the sharp instance on top — the element is then drawn over the smear at full opacity, so the position the frame is actually at stays crisp and only the duplicates are faint. This is the single largest difference from a plain average, and the one that makes the result read like After Effects rather than like a long exposure.
  4. Rest is sharp — when the sampled positions collapse onto the current one, the filter is removed.
The defaults come from measurement, not from the After Effects UI’s nominal values. On a 1920×1080 / 30 fps export of translating text, the outermost duplicate on each side sits exactly one frame away from the frame time, with 8 evenly spaced duplicates between it and the centre — a 720° window at −360° phase, divided into 16. The staircase across a stroke steps by 0.063 ± 0.002 of the sharp text intensity per duplicate: flat 1/16, no taper toward the window edges. Replaying that export through this component scores 32.5 dB mean PSNR against it (min 27.6 over the 72 translating frames), against 24.2 dB (min 17.1) for the previous half-frame centred window. Copies follow the real trajectory, so eased and curved motion smear correctly. The element’s own scale and rotation are compensated when mapping the displacements into filter space; skew, 3D rotation and transformed ancestors are not. Only translation is integrated — rotation, scale or opacity changes within the shutter window are not blurred.

Options

Tagged effect motion-blur shutter after-effects velocity animation.