You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2bb7da
Browse filesBrowse the repository at this point in the historyBrowse files
feat(core): auto motion blur draws with the filter tier (#7288)
* feat(core): auto motion blur draws with the filter tier
Capture stays available as data-motion-blur-tier="capture". auto now draws with the
filter tier (reasonCode tier-auto), so the capture-only defects leave the default path.
Removes the translation-only hand-off and its Discovery field, adds a filter arm to the
differential, and updates the check, guide, skill and Blur panel label.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* docs(core): measured cost and known limits of the filter tier, the new auto default
spacex-launch (77 movers) takes 2.9x the CPU of no blur on the filter tier and 1.7x on
capture; say so, and list the filter tier's measured limits (sweep D, E, F, I, O, B).
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* docs(core): word the filter tier's cost and limits as measured, not as mechanism
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* docs(core): do not say every filter-tier limit is pinned by a sweep test
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
* test(engine): split the blur differential so each file fits the flake gate's 120 s run
The filter arm moves to its own file and skips fixtures that already draw with the filter
tier; inside cases get their own file; a fixture's blur-off page is opened once per file.
Shared helpers live in __fixtures__/motionBlur/differentialPage.ts.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---------
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/guides/motion-blur.mdx
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ That is all. The same attribute drives the browser editor preview and `hyperfram
31
31
|`data-motion-blur-phase`| centred | When the shutter opens, in degrees of a frame, -360 to 360. The window starts at `t + phase / 360 / fps` and lasts `shutter / 360 / fps`. `0` opens on the frame, so the smear trails ahead of it; unset centres it, the same as minus half the shutter. Matches After Effects' Shutter Phase. |
32
32
|`data-motion-blur-samples`| at least 32 | A fixed number of samples per frame, 2–64. Left unset, each mover gets at least 32, and about one per 2 px of smear when that is more, so a fast move never shows steps. |
33
33
|`data-motion-blur-events`| off |`on` runs timeline callbacks (`onUpdate` and similar) while blur looks for movers, and at each sample when a callback changes an element's inline style or its box. Needed when the motion is set from a callback, such as a `render(t)` function, which blur cannot otherwise see. |
34
-
|`data-motion-blur-tier`|`auto`|`capture` or`filter`forces one of the two ways blur is drawn (below). |
34
+
|`data-motion-blur-tier`|`auto`|`auto` and`filter`draw with the filter tier; `capture` asks for the capture tier (below). |
35
35
36
36
## In the browser editor
37
37
@@ -43,15 +43,19 @@ Elements that move quickly in 2D: position, scale and rotation changes from GSAP
43
43
44
44
## Two ways it is drawn
45
45
46
-
**Capture**copies each mover out of the page with Chrome's [HTML in Canvas](/guides/html-in-canvas) API and redraws it along its path. It draws turns and zooms truthfully: a spinning tile smears along its arc and its centre stays sharp, and a zoom streaks outward.
46
+
**Filter**puts an SVG filter on each mover: copies of the element along its path, averaged, and softened along the motion. It is what `data-motion-blur-tier="auto"` (the default) draws with. It works in any Chrome and over a WebGL canvas. On a four-whip test it cost about what a render without blur costs; on two real films it cost more than capture (see Cost and limits). Turns and zooms are only softened, not streaked.
47
47
48
-
**Filter**puts an SVG filter on each mover: copies of the element along its path, averaged, and softened along the motion. It works in any Chrome, over a WebGL canvas, and costs about what a render without blur costs. Turns and zooms are only softened, not streaked.
48
+
**Capture**is opt-in with `data-motion-blur-tier="capture"`. It copies each mover out of the page with Chrome's [HTML in Canvas](/guides/html-in-canvas) API and redraws it along its path. It draws turns and zooms truthfully: a spinning tile smears along its arc and its centre stays sharp, and a zoom streaks outward. It has limits of its own, listed here (the filter tier's are listed under Cost and limits, and a few, such as `backdrop-filter`, apply to both), so ask for it only for a film whose spins and zooms need the streak:
49
49
50
-
With `data-motion-blur-tier="auto"` (the default), blur uses the filter tier when every mover only translates and capture when anything turns or scales, because for translation the two look the same and the filter tier is much cheaper.
50
+
- Anything in front of a mover is lost: a static panel, an overlay or a title card over a moving element is drawn behind its smear.
51
+
-`mix-blend-mode` and `backdrop-filter` on a mover or its ancestor are not applied.
52
+
- A CSS selector that reaches the root through its parent, such as `body > #root > .m`, stops matching once capture wraps the root.
53
+
- A mover sliding into an `overflow: hidden` or clipped card drags the clip edge along, two overlapping movers carry each other's pixels, and content past the frame edge leaves a thin band.
54
+
- In preview, the first frame after every play shows black for a moment.
51
55
52
56
Capture needs a browser with HTML in Canvas. Chrome 157 and 158 builds exposed it without a flag in headless and Chrome-for-Testing builds; whether stable Chrome does is unverified. Chrome 155 and earlier need `chrome://flags/#html-in-canvas`.
53
57
54
-
Blur uses the filter tier instead of capture when capture cannot run:
58
+
A page that asks for capture gets the filter tier instead when capture cannot run:
55
59
56
60
| Found in the composition | Why capture cannot draw it |
57
61
| --- | --- |
@@ -75,17 +79,24 @@ npx hyperframes check
75
79
76
80
| Finding | Severity | Meaning |
77
81
| --- | --- | --- |
78
-
|`motion_blur_filter_fallback`| info |Capture could not run, so the filter tier draws. The message names the cause and how to get capture back. |
82
+
|`motion_blur_filter_fallback`| info |The page asked for capture, which could not run, so the filter tier draws. The message names the cause. |
79
83
|`motion_blur_no_movers`| info | Blur is on but nothing moves fast enough to blur. If the motion is set from a callback, add `data-motion-blur-events="on"`. |
80
-
|`motion_blur_unverified`| info | The check browser cannot run capture, so it drew with the filter tier. Render once to see capture. |
84
+
|`motion_blur_unverified`| info | The page asks for capture and the check browser cannot run it, so it drew with the filter tier. Render once to see capture. |
81
85
82
86
In the page, `window.__hfMotionBlur.report()` returns `state`, `tier`, `reason`, `reasonCode` and `movers`. A render logs one line per session with the tier, and a session-end line when any frames fell back to sharp (`failedFrames > 0`).
83
87
84
88
## Cost and limits
85
89
86
-
-**Render time.** On an 8 s test composition with four whips, a render took 9.8 s with capture, 5.2–5.4 s with the filter tier and 5.3–5.9 s with no blur (two runs each, including startup). Capture adds a second paint per blurred frame; the filter tier adds almost nothing.
87
-
-**Editing.** With capture the root is wrapped only while playing or rendering; paused, it is plain DOM, so click-to-select works. The filter tier never wraps anything.
90
+
-**Render time.**It varies by film. On an 8 s test composition with four whips, a render took 9.8 s with capture, 5.2–5.4 s with the filter tier and 5.3–5.9 s with no blur (two runs each, including startup). On two real 1080p films the filter tier cost more than capture, measured as CPU seconds of the whole render (wall time was too noisy on a loaded machine): `spacex-launch` (77 movers, 39.5 s) took 547–552 CPU s with the filter tier, 302–320 with capture and 184–193 with no blur (three runs each, 2.9 times no blur); `k3-promo` (106 movers, 16.5 s) took 236, 205 and 117 (one run per arm, 2.0 times no blur). The two films do not order by mover count, and the cause of the difference was not isolated. The filter tier draws each mover as at least 32 offset copies per frame; capture adds a second paint per blurred frame.
91
+
-**Editing.**The filter tier never wraps anything. With capture the root is wrapped only while playing or rendering; paused, it is plain DOM, so click-to-select works.
88
92
-**Capture only.** Blurred preview can run at half the frame rate on heavy compositions, and a `<video>` drawn through the capture looks about 2–3% darker in the browser editor preview than in normal playback. Renders are not affected.
89
-
-**Preview and render.**A browser without HTML in Canvas previews with the filter tier. A render then uses capture where the composition needs it, so a spin or zoom looks softer in that preview than in the render. Force one tier with `data-motion-blur-tier` for an exact match.
93
+
-**Preview and render.**`auto` draws the same way in both. A page that asks for capture previews with the filter tier in a browser without HTML in Canvas, so a spin or zoom looks softer there than in the render.
90
94
-**Worker count.** Output is not bit-identical between worker counts (around 60 dB PSNR), about the size of the difference chunking already causes.
91
95
-**Not handled.** Pose errors under CSS `zoom`, `position: fixed` and `foreignObject`; a very short Web Animations API animation that falls between scan samples; a large see-through mover (a full-frame translucent sweep), which is left sharp while its fast children still blur. With capture, a mover is drawn above the static content, so a static element that should cover a mover does not.
96
+
-**Limits of the filter tier** (the default), as measured on one-pattern test compositions:
97
+
-`::before` or `::after` content outside the mover's box is cut off.
98
+
- A mover's own `clip-path` or mask gets hard edges: the smear is clipped to the shape it has at that frame.
99
+
- A `position: fixed` child of a mover that moves via `left` jumps, because the filter makes the mover its containing block.
100
+
- A `:last-child` selector on the root's children also matches the `<svg>` the tier adds to the root (`nth-last-*` works the same way but was not measured).
101
+
- A visibility toggle inside the shutter window is drawn at full strength instead of half.
102
+
-`backdrop-filter` on a mover differs from the 32-sample oracle in the sweep (the backdrop only).
Copy file name to clipboardExpand all lines: packages/cli/src/docs/motion-blur.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,14 @@ Fast-moving elements get a shutter smear along their path. It is opt-in: nothing
9
9
-`data-motion-blur-phase` — when the shutter opens, in degrees of a frame, -360 to 360: 0 opens on the frame (default: centred on the frame, which is minus half the shutter)
10
10
-`data-motion-blur-samples` — samples per frame, 2-64 (default: at least 32, sized to the smear)
11
11
-`data-motion-blur-events` — `on` runs timeline callbacks while blur looks for movers; needed when motion is set from a `render(t)` callback
12
-
-`data-motion-blur-tier` — `auto` (default), `capture` or `filter`
12
+
-`data-motion-blur-tier` — `auto` (default, draws with `filter`), `filter` or `capture`
13
13
14
14
The same attributes drive the browser editor preview and `hyperframes render`.
15
15
16
16
## Two ways it is drawn
17
17
18
-
-`capture` redraws each mover along its path, so turns and zooms smear truthfully. Needs a browser with HTML in Canvas.
19
-
-`filter` puts an SVG filter on each mover. Works in any Chrome and costs little; turns and zooms are only softened.
20
-
21
-
`auto` uses `filter` when every mover only translates and `capture` when anything turns or scales.
18
+
-`filter` puts an SVG filter on each mover. Works in any Chrome; cost varies by film (one with 77 movers took about 2.9 times the CPU of no blur and 1.75 times `capture`'s; the cause was not isolated); turns and zooms are only softened. `auto` draws with it. It cuts off `::before`/`::after` content outside a mover's box, gives a mover's own `clip-path` or mask hard edges, makes a `position: fixed` child of a mover that moves via `left` jump, lets a `:last-child` selector match the `<svg>` it adds to the root, draws a visibility toggle inside the shutter at full strength, and differs from the oracle for `backdrop-filter` on a mover.
19
+
-`capture` is opt-in. It redraws each mover along its path, so turns and zooms streak truthfully. Needs a browser with HTML in Canvas. It loses anything drawn in front of a mover, ignores `mix-blend-mode` on movers, and breaks selectors that reach the root through its parent.
0 commit comments