feat(engine): implement motion blur via temporal supersampling#61
Merged
Conversation
MotionBlurConfig was parsed and discarded since its introduction. Both effects now materialize as ghost BoxNodes built by build_child: css re-resolved at offset times (shutter window for motion_blur, spacing steps for trail), painted beneath the principal via the new BoxKind::Ghost (excluded from the hit-map). Opacity formula proven by the static test: ghosts at 1/(samples+1), principal at full — the all-attenuated alternative washes static components to ~0.66. BuildAnimationCtx gains fps (shutter is a frame fraction). Documented v1 limits: ghost internal animations sample frame time; container ghosts don't recurse into children.
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #49.
Goal: the
motion_blurschema effect was a phantom (parsed in the animator, then discarded). Implemented deterministically, plus atraileffect.build_childre-resolves the CSS at offset times —t − i·(shutter/fps)/samplesfor motion blur,t − i·spacingfor trail — and emits ghostBoxNodes painted beneath the principal. NewBoxKind::Ghostpaints like a component but never records hits.1/(samples+1), principal at full opacity — a static component stays visually identical (the all-attenuated alternative converges to ~0.66 brightness and was rejected on evidence). Trail usesfalloff^ipersistence.samples(default 6, clamped 1–16) +shutter(frame fraction, default 0.5) onMotionBlurConfig; newtrail {copies, spacing, falloff}effect;BuildAnimationCtxgainsfps.Tests: 4 new pixel tests (broadened span + intermediate intensities mid-motion, trail band count with decaying intensity, static invariance, samples=1 degeneracy). 307 total, all green.
Verify:
cargo test --workspace→ 307 passed ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓