EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
Merge main into M12.7 (environment background layers keep their 3D runs on the CPU path)
Brandon Thomase7fdd6fdbd78
diff --cc crates/render/src/three_d/compose.rsindex beed82f0c,732aee685..b134c88f2--- a/crates/render/src/three_d/compose.rs+++ b/crates/render/src/three_d/compose.rs@@@ -629,82 -624,6 +638,83 @@@ fn occlusion(c: &Item, p: Vec3, l: &Ligout}+// ------------------------------------------------------------------ accelerator export++/// A Classic 3D run prepared for an accelerator ([`Renderer::prepare_3d_run`]): every plane+/// with its geometry, material and buffer, ready for the per-pixel depth sort, lighting and+/// ray-cast shadows of [`draw_run`] on another device.+#[derive(Clone, Debug)]+pub struct Run3d {+ /// Drawn planes in stack order, then shadow casters from outside the run (`draw` false).+ pub planes: Vec<Plane3d>,+ /// Indices (into `planes`) of the shadow casters, in the CPU's order.+ pub casters: Vec<usize>,+ pub lights: Vec<LightState>,+ /// Dissolve seed of the run.+ pub seed: u32,+}++/// One plane of a [`Run3d`].+#[derive(Clone, Debug)]+pub struct Plane3d {+ /// The layer buffer (blending space; depth of field already applied).+ pub buf: Arc<Buf>,+ pub bicubic: bool,+ /// One per motion-blur sub-sample (equal weights).+ pub geos: Vec<Geo>,+ pub mat: Material,+ pub opacity: f32,+ pub draw: bool,+ /// Screen-space track matte factor (output size, row-major).+ pub matte: Option<Arc<Vec<f32>>>,+ pub preserve: bool,+ /// World → layer, and the (blurred) buffer's layer-space bounds.+ pub winv: Mat4,+ pub bounds: [f64; 4],+ /// Output pixel bounds of all geometries.+ pub bbox: [i64; 4],+ /// Stack order (coplanar fragments draw lower orders first).+ pub order: usize,+ pub layer_id: u32,+ pub mode: BlendMode,+}++/// Prepare a run of 3D layers for an accelerator. `None` when the run must be drawn on the CPU- /// (adjustment or wireframe layers, Advanced 3D).++/// (adjustment, wireframe or environment background layers, Advanced 3D).+pub(crate) fn gpu_run(r: &Renderer, ctx: &EvalCtx, run: &[&Layer], out: (u32, u32)) -> Option<Run3d> {- if run.is_empty() || run.iter().any(|l| l.switches.adjustment || l.switches.quality == effectcraft_project::Quality::Wireframe) {++ if run.is_empty() || run.iter().any(|l| l.switches.adjustment || l.environment_background || l.switches.quality == effectcraft_project::Quality::Wireframe)++ {+ return None;+ }+ if ctx.comp.renderer == effectcraft_project::Renderer::Advanced3D && r.collapse3d.is_none() {+ return None;+ }+ let g = gather(r, ctx, run, out);+ let planes: Vec<Plane3d> = g+ .items+ .into_iter()+ .chain(g.extra)+ .map(|it| Plane3d {+ layer_id: it.layer.id.0 as u32,+ mode: it.layer.blend_mode,+ buf: it.buf,+ bicubic: it.bicubic,+ geos: it.geos,+ mat: it.mat,+ opacity: it.opacity,+ draw: it.draw,+ matte: it.matte,+ preserve: it.preserve,+ winv: it.winv,+ bounds: it.bounds,+ bbox: it.bbox,+ order: it.order,+ })+ .collect();+ let casters = planes.iter().enumerate().filter(|(_, p)| p.mat.casts_shadows != 0 && !p.geos.is_empty()).map(|(i, _)| i).collect();+ Some(Run3d { planes, casters, lights: g.lights, seed: run[0].id.0 as u32 })+}+// ------------------------------------------------------------------ auxiliary render pass/// One surface seen through an output pixel (aux pass).diff --cc docs/effects.mdindex eb6d9b00a,a7717d75d..847352865--- a/docs/effects.md+++ b/docs/effects.md@@@ -3,11 -3,11 +3,11 @@@<!-- Generated from the effect registry (crates/effects/src/catalog.rs); do not edit by hand.Regenerate: UPDATE_DOCS=1 cargo test -p effectcraft-effects --lib effects_doc_is_current -->- EffectCraft ships 303 effects with 2434 parameters in total, grouped into the same categories as the Effects & Presets panel. Every effect is our own implementation, written from public behaviour descriptions and standard image-processing literature. Parameter names, order, popup options, units, defaults and ranges follow the reference application so that projects, expressions and muscle memory carry over.+ EffectCraft ships 304 effects with 2446 parameters in total, grouped into the same categories as the Effects & Presets panel. Every effect is our own implementation, written from public behaviour descriptions and standard image-processing literature. Parameter names, order, popup options, units, defaults and ranges follow the reference application so that projects, expressions and muscle memory carry over.- - **GPU**: 58 effects also run on the GPU compositor with identical results.- - **32**: 303 effects process 32-bit float (HDR, overbright) pixels without clamping.- - **Status**: 261 implemented in full, 42 partial (what is missing is listed).-- **GPU**: 25 effects also run on the GPU compositor with identical results.++- **GPU**: 59 effects also run on the GPU compositor with identical results.+ - **32**: 304 effects process 32-bit float (HDR, overbright) pixels without clamping.+ - **Status**: 262 implemented in full, 42 partial (what is missing is listed).Effects are addressed by id (`ec.<category>.<name>`) or display name in commands, scripts and the control channel, and every parameter by its id (`effects/#1/blurriness`).@@@ -111,10 -111,10 +111,10 @@@| Leave Color | `ec.color.leavecolor` | 5 | | 32 | Implemented || Levels | `ec.color.levels` | 7 | GPU | 32 | Partial: master channel only (no Channel popup) || Levels (Individual Controls) | `ec.color.levelsic` | 27 | | 32 | Implemented |-| Lumetri Color | `ec.color.lumetri` | 38 | | 32 | Partial: no HSL Secondary, hue/saturation curves, HDR mode or look files |+| Lumetri Color | `ec.color.lumetri` | 38 | GPU | 32 | Partial: no HSL Secondary, hue/saturation curves, HDR mode or look files || OCIO CDL Transform | `ec.color.ociocdl` | 12 | | 32 | Implemented |- | OCIO Color Space Transform | `ec.color.ociocolorspace` | 4 | | 32 | Implemented |- | OCIO Display Transform | `ec.color.ociodisplay` | 5 | | 32 | Implemented |+ | OCIO Color Space Transform | `ec.color.ociocolorspace` | 7 | | 32 | Implemented |+ | OCIO Display Transform | `ec.color.ociodisplay` | 9 | | 32 | Implemented || OCIO File Transform | `ec.color.ociofile` | 4 | | 32 | Implemented || OCIO Look Transform | `ec.color.ociolook` | 6 | | 32 | Implemented || PS Arbitrary Map | `ec.color.psarbitrarymap` | 2 | | 32 | Implemented |diff --cc docs/parity.mdindex f703644a9,38df7882b..4437becec--- a/docs/parity.md+++ b/docs/parity.md@@@ -20,12 -20,12 +20,11 @@@ Animation 94%, Masks 94%, Preview 94%,Tracking 88%, Effects 85%, Web 65%.What is left, in priority order: the web app's depth (threads, storage, audio, non-blocking-renders); stroke taper/wave and multi-segment dashes; variable mask feather points; camera iris/bokeh and focus-link commands; GPU-rendering of 3D runs and adjustment layers; Render Queue field render, crop/resize and templates;+renders); stroke taper/wave and multi-segment dashes; variable mask feather points; camera iris/bokeh and focus-link commands; Render Queue field render, crop/resize and templates;- approximated effects (Subspace Warp, Key Cleaner) and Liquify's viewer brush; Advanced 3D motion blur- and blend modes; a few viewer and colour-management menu items; OpenType features and variable+ approximated effects (Subspace Warp, Key Cleaner) and Liquify's viewer brush; OpenType features and variablefont axes; AI/EPS/PDF import; more codecs; 59 preferences not yet wired; ScriptUI;Lumetri Scopes, Footage, Media Browser and Metadata panels; Content-Aware Fill; face tracking; and-the "better than After Effects" items (a plug-in API, branching history, GPU particles).+the "better than After Effects" items (a plug-in API, branching history; GPU particles landed in M12.7).The sections below are the original audit (morning of 2 October, ≈ 64%) and its updates, kept forhistory.@@@ -119,12 -119,12 +118,12 @@@ the disk cache in the formats wave; th| Animation | 67% | 10.0 | puppet, Wiggler/Smoother/Motion Sketch (motion-path handles and the graph editor transform box landed in M5.8; keyframe colour labels and Select Keyframe Label Group, Graph Editor snapping to markers / layer ends in M13.5) || Text | ≈ 91% | 0.8 | no OpenType feature panel, no extruded strokes, variable-axis animation changes outlines but not advances (vertical Roman / Tate-Chu-Yoko, forced LTR paragraphs, caret on animated and path text, Variable Font Axes and Lottie style runs landed in M13.5; extruded, bevelled text in M7.6; per-character styles, paragraph settings, on-canvas editing and the `sourceText` style API in M9.9–M9.10) || Web | 85% | 1.0 | viewer frames and Roto Brush propagation still on the page's thread; GPU effects in the browser (browser storage, Web Audio, Web Worker renders/analyses, WebGPU viewer and offline install landed in M15.2) |- | 3D | 78% | 9.3 | multi-view layouts, Advanced 3D motion blur and blend modes (and iris shapes in Advanced 3D's depth of field), cameras/lights from models; Classic 3D iris-shaped bokeh with highlights, progressive depth of field on tilted layers and the focus-link commands landed in M13.5; Advanced 3D (glTF/OBJ models, primitives, extruded text and shapes, PBR, image-based light, shadow maps, GPU rasteriser) in M7.4–M7.6 |+ | 3D | 85% | 6.5 | multi-view layouts, iris shapes in Advanced 3D's depth of field, collapsed 3D precomps in Advanced 3D, the Extended Viewer; stereo rigs, orbit nulls, lights controlled by the camera, cameras/lights from glTF models, environment backgrounds, Advanced 3D motion blur, blend modes and track mattes landed in M7.7; Classic 3D iris-shaped bokeh with highlights, progressive depth of field on tilted layers and the focus-link commands landed in M13.5; Advanced 3D (glTF/OBJ models, primitives, extruded text and shapes, PBR, image-based light, shadow maps, GPU rasteriser) in M7.4–M7.6 |-| Effects | ≈ 80% | 4.5 | GPU versions of more effects and the missing controls listed as partial in [effects.md](effects.md) (every After Effects effect exists since M9.11, M12.5 and M12.6; parameter names, order, twirl-downs, popups, units and defaults were aligned in M9.12) |+| Effects | ≈ 80% | 4.0 | GPU versions of the remaining effects (58 run on the GPU since M12.7) and the missing controls listed as partial in [effects.md](effects.md) (every After Effects effect exists since M9.11, M12.5 and M12.6; parameter names, order, twirl-downs, popups, units and defaults were aligned in M9.12) || Interface | 74% | 5.0 | a richer Learn area (Timeline outline and Project panel columns scroll horizontally, the Layer Style dialog, ROI resize handles, Pan Behind snapping and 3D Reference Axes landed in M13.5; native macOS menu bar, Timeline columns/search/reveal-add, Home screen with recent projects and all AE workspaces landed; viewer rulers/snapping/channels/snapshots landed in M0.13) |- | Project | ≈ 60% | 6.5 | 8/16/32-bit pipeline and colour management, auto-save, folder moves (proxies and Interpret Footage fields / pixel aspect / alpha guess landed: PRJ-8, PRJ-3) |+ | Project | ≈ 68% | 5.5 | auto-save, folder moves, OCIO displays beyond the built-in tone map (Color Engine with OCIO/ACES working spaces, HDR compand/tone mapping, Rec. 2100 PQ/HLG output, Feet + Frames, display colour management, Simulate Output and the locked viewer landed in M7.7; proxies and Interpret Footage fields / pixel aspect / alpha guess landed: PRJ-8, PRJ-3) || Masks & roto | 74% | 5.0 | Roto Brush's learned (3.0) segmentation model (variable-width mask feather points with the Mask Feather tool landed in M13.5; mask tracking and Mask Interpolation landed in M6.6; Roto Brush & Refine Edge with graph-cut segmentation, flow propagation, edge matting, decontamination and Freeze in M6.7) |-| Preview | 62% | 5.0 | GPU 3D and adjustment layers (persistent disk cache with the blue cache bar landed; region of interest, snapshots, exposure and Fast Previews landed in M0.13) |+| Preview | 66% | 4.0 | GPU bokeh depth of field, wireframes and Advanced 3D compositing (Classic 3D runs and adjustment layers composite on the GPU since M12.7; persistent disk cache with the blue cache bar landed; region of interest, snapshots, exposure and Fast Previews landed in M0.13) || Tracking | ≈ 85% | 2.5 | face tracking, Subspace Warp's mesh warp, lens distortion in the camera solve (Rolling Shutter Repair landed in M9.11; point tracker, mask tracking, Warp Stabilizer and the 3D Camera Tracker landed in M6.x / M12.5 / M12.6) || Paint | 0% | 4.0 | Brush, Clone Stamp, Eraser |