From 237248321a1a40b9b98e7e0a6df156d0aa247ef0 Mon Sep 17 00:00:00 2001 From: cashmere Date: Sun, 2 Aug 2026 19:59:32 +0200 Subject: feat: pan & zoom motion presets Ken Burns-style motion effects (zoom in/out, pan left/right/up/down) that drag onto clips like regular effects. Instead of shader passes they evaluate a per-frame transform offset in resolveVisualState, so they stack with keyframed transforms and work in preview and export. - intensity param (0-100%, keyframable) scales the whole effect - easing select maps progress through the graph editor's bezier presets - supportsStandalone: false hides them from effect-track creation - empty shader pass groups are filtered out so pass-less effects and zero-intensity blur no longer crash the compositor --- docs/effects-renderer.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/effects-renderer.md') diff --git a/docs/effects-renderer.md b/docs/effects-renderer.md index d68cec21..54ffc93c 100644 --- a/docs/effects-renderer.md +++ b/docs/effects-renderer.md @@ -15,6 +15,16 @@ An effect definition has: All effects use the shared GPU renderer. TypeScript decides which shader identifiers to run and which uniforms to pass. Rust/wgpu owns device creation, textures, and pass execution. +## Motion presets (pan & zoom) + +Effects can also modulate an element's transform instead of running shader passes. A definition with a `motion` config (see `apps/web/src/effects/definitions/motion.ts`) evaluates a per-frame `MotionOffset` (scale multiplier + translate as canvas fraction) from an eased progress over the clip duration. `applyMotionEffects` in `apps/web/src/effects/motion.ts` composes these onto the resolved transform in `resolveVisualState`, so they work in preview and export and stack with keyframed transforms. + +- Built-in presets: `zoom-in`, `zoom-out`, `pan-left/right/up/down` +- `intensity` (0–100, keyframable) scales the whole effect proportionally +- `easing` (select) maps linear progress through the graph editor's `BUILTIN_PRESETS` cubic-beziers — non-linear by default ("smooth") +- Motion effects set `supportsStandalone: false` — they only make sense on a clip, so the assets panel hides the add-to-timeline button and dropping on empty timeline space is a no-op +- `renderer.passes` is `[]` for motion-only effects; they contribute no shader work + ## Single-pass vs multi-pass The renderer supports a `passes` array. Single-pass effects (e.g. color grading) just have one entry. Multi-pass is needed when an effect has to process its own output — blur (H then V), bloom (extract → blur → composite), glow, etc. -- cgit v1.3.1