Skip to content

Commit 5c47fc3

Browse files
fix(registry): make motion-blur match After Effects shutter-based blur
The motion-blur catalog snippet estimated speed from the x/y delta between consecutive timeline updates and drew three one-sided ghost copies with decaying alpha plus a Gaussian on top. After Effects does temporal supersampling: each frame integrates the layer over a shutter window (shutter angle, shutter phase, samples per frame), producing a symmetric box smear of length speed x shutter time. The snippet now does the same inside the page. After every timeline update a deferred pass seeks the GSAP timeline to N sub-frame times across the shutter window (events suppressed), reads each target's x/y, restores the frame time, and drives an SVG filter that averages N feOffset copies with equal weight (feComposite arithmetic, 1/N, sRGB). Defaults follow AE: shutterAngle 180, shutterPhase -90, samplesPerFrame 16; fps comes from the render config, then the root data-fps, then 30. Displacements are mapped through the inverse of the element's own scale/rotation; percent x/y values are resolved to px; SVG targets use their bbox; an existing inline filter is kept and the blur appended to it. The pass runs in a microtask rather than inside the tracker tween's onUpdate, because seeking GSAP from within its own render reads stale tween state and suppresses the composition's callbacks on forward seeks. The heuristic options blurScale/blurMax/stretchScale/stretchMax are removed. Reference: an AE-algorithm reconstruction of the same composition rendered without the component at an effective 960 fps and averaged over the 16 sub-frames of the 180 degree window per output frame. Against it (1920x1080, 30 fps, solid + text translating linear then power2.inOut): old mean PSNR 53.2 dB (min 26.7), SSIM 0.9930; new mean PSNR 72.4 dB (min 52.6), SSIM 0.9998. The 10-90 edge ramp at 66.7 px/frame is 26.8 px in the reference, 27.5 px new, 14.5/6.3 px (one-sided) old; at the ease peak 79.3 vs 79.5 vs 7.9/17.7 px, with smear centres matching to 0.1 px. Co-Authored-By: Miguel Ángel <[email protected]>
1 parent 3704863 commit 5c47fc3

10 files changed

Lines changed: 897 additions & 628 deletions

File tree

‎docs/catalog/components/motion-blur.mdx‎

Lines changed: 241 additions & 165 deletions
Large diffs are not rendered by default.

‎docs/public/catalog-index.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,13 +3340,14 @@
33403340
"name": "motion-blur",
33413341
"type": "component",
33423342
"title": "Motion Blur",
3343-
"description": "Velocity-driven motion blur — samples element position each frame and applies a one-sided SVG feGaussianBlur ghost trail proportional to speed",
3343+
"description": "After Effects-style motion blur — integrates each element over a shutter window (shutter angle, phase, samples per frame) by sampling the GSAP timeline at sub-frame times and averaging equal-weight SVG copies along the real trajectory",
33443344
"tags": [
33453345
"effect",
33463346
"motion-blur",
3347+
"shutter",
3348+
"after-effects",
33473349
"velocity",
3348-
"animation",
3349-
"physics"
3350+
"animation"
33503351
],
33513352
"href": "/catalog/components/motion-blur",
33523353
"preview": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/components/motion-blur.png"

‎docs/public/catalog/components/motion-blur.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
0 Bytes
Binary file not shown.

‎registry/catalog-artifact/local-vectors.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"model": "bge-small-en-v1.5",
33
"modelRevision": "ea104dacec62c0de699686887e3f920caeb4f3e3",
44
"dimensions": 384,
5-
"revision": "b33b552d4f830abfcccb2bfe9495ac6284a7e7c05b3d3f4df630dfd5e753e518",
5+
"revision": "34370735fa1a93099519873178e547c43b14f3bd69491013577515f4bb4f5957",
66
"names": [
77
"ai-chat-reveal",
88
"animated-bar-chart",

‎registry/components/motion-blur/demo.html‎

Lines changed: 203 additions & 143 deletions
Large diffs are not rendered by default.

‎registry/components/motion-blur/motion-blur.html‎

Lines changed: 239 additions & 163 deletions
Large diffs are not rendered by default.

‎registry/components/motion-blur/registry-item.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "motion-blur",
44
"type": "hyperframes:component",
55
"title": "Motion Blur",
6-
"description": "Velocity-driven motion blur — samples element position each frame and applies a one-sided SVG feGaussianBlur ghost trail proportional to speed",
7-
"tags": ["effect", "motion-blur", "velocity", "animation", "physics"],
6+
"description": "After Effects-style motion blur — integrates each element over a shutter window (shutter angle, phase, samples per frame) by sampling the GSAP timeline at sub-frame times and averaging equal-weight SVG copies along the real trajectory",
7+
"tags": ["effect", "motion-blur", "shutter", "after-effects", "velocity", "animation"],
88
"files": [
99
{
1010
"path": "motion-blur.html",

‎registry/examples/motion-blur/index.html‎

Lines changed: 205 additions & 149 deletions
Large diffs are not rendered by default.

‎registry/registry.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,6 @@
16371637
}
16381638
],
16391639
"catalogArtifact": {
1640-
"revision": "b33b552d4f830abfcccb2bfe9495ac6284a7e7c05b3d3f4df630dfd5e753e518"
1640+
"revision": "34370735fa1a93099519873178e547c43b14f3bd69491013577515f4bb4f5957"
16411641
}
16421642
}

0 commit comments

Comments
 (0)