diff --git a/compatibility.md b/compatibility.md index 3cc5ce3515be86ed703e5c91b7fb824b314a75cb..45f364ae6a7470ea760c2d3bb18dbd13eb9f6553 100644 --- a/compatibility.md +++ b/compatibility.md @@ -2,18 +2,18 @@ # Fusion 21.1 Compatibility -Fission currently supports **125** tool types across 2D/3D compositing, all with high accuracy. This document tracks the progress on parity with Blackmagic Fusion Studio. The main metric, **accuracy**, is the inverse of the image's [mean absolute error](https://en.wikipedia.org/wiki/Mean_absolute_error), meaning `100%` accuracy means the pixels are all identical. For details, see [`scripts/fuzz_node.py`](scripts/fuzz_node.py). +Fission currently supports **126** tool types across 2D/3D compositing, all with high accuracy. This document tracks the progress on parity with Blackmagic Fusion Studio. The main metric, **accuracy**, is the inverse of the image's [mean absolute error](https://en.wikipedia.org/wiki/Mean_absolute_error), meaning `100%` accuracy means the pixels are all identical. For details, see [`scripts/fuzz_node.py`](scripts/fuzz_node.py). ## Summary | Metric | Value | | --- | --- | -| **Supported Tools** | **125** | +| **Supported Tools** | **126** | | **Modifiers & Animation** | **8** | | **Accuracy across [paper clover](https://paperclover.net)'s compositions** | **99.5%** | | **Supported Tool Accuracy** | **99.7%** | -| **Supported Tools with 100% Accuracy** | **46** | -| **Coverage of Fusion's Built-in Tools** | **28.0%** | +| **Supported Tools with 100% Accuracy** | **48** | +| **Coverage of Fusion's Built-in Tools** | **28.3%** | | **Coverage of All Fuses on Reactor** | **0.5%** | ## Generators @@ -32,7 +32,7 @@ Fission currently supports **125** tool types across 2D/3D compositing, all with | Tool | Accuracy | Notes | | --- | --- | --- | -| `Merge` | 99.0% | 3D Z-depth merge (`PerformDepthMerge`) not implemented. | +| `Merge` | 99.0% | — | | `Dissolve` | ✅ 100.0% | — | | `Paint` | 98.8%–100.0% | Clone/Smear/Emboss apply modes and non-round image brushes not yet implemented. | | `PolylineStroke` | 99.7%–100.0% | Rendered only inside `Paint` / `PaintMask`. | @@ -76,6 +76,7 @@ Fission currently supports **125** tool types across 2D/3D compositing, all with | `SoftGlow` | 99.8% | — | | `Fuse.XGlow` | 99.2%–99.8% | Octave-capped in `Fast` mode. | | `ErodeDilate` | ✅ 100.0% | — | +| `VectorMotionBlur` | ✅ 100.0% | Reads `VectorInput` or upstream `aux.vector` from `Dimension.OpticalFlow`. | | `RemoveNoise` | ✅ 100.0% | — | | `FilmGrain` | 96.3% | Stochastic per-frame PRNG seed differs from Fusion. | | `Fuse.Outline` | 99.5%–99.9% | — | @@ -87,7 +88,7 @@ Fission currently supports **125** tool types across 2D/3D compositing, all with | Tool | Accuracy | Notes | | --- | --- | --- | -| `Transform` | ✅ 100.0% | Motion blur sub-frame accumulation not implemented. | +| `Transform` | ✅ 100.0% | — | | `CameraShake` | 99.9% | — | | `CornerPositioner` | 99.7% | — | | `PerspectivePositioner` | 99.7% | — | @@ -180,7 +181,7 @@ Each 3D tool's accuracy is measured by rendering it inside a lit `Merge3D` + `Ca | --- | --- | --- | | `Saver` | ✅ 100.0% | Interactive Flow passthrough; export supports PNG sequences and MP4/ProRes4444. | | `Dimension.OpticalFlow` | 99.9% | — | -| `Dimension.CopyAux` | Visual* | Passes RGBA through unchanged; engine carries no auxiliary channels (`Z`, `Coverage`, `ObjectID`, `Vector`). | +| `Dimension.CopyAux` | ✅ 100.0% | Supports `Z`, `Normal`, `Vector`, and `BackVector` aux channels (`Mode` 0/1, remapping, `KillAuxChannels`). | | `TimeStretcher` | ✅ 100.0% | — | | `TimeSpeed` | ✅ 100.0% | — | | `Switch` | ✅ 100.0% | — | diff --git a/crates/app/src/add_tool.rs b/crates/app/src/add_tool.rs index fd042e2b6f36292c6868b7ee5f82f0f6282241a7..cb0eca2130aba3f47e55b647a442bc07d819f0e2 100644 --- a/crates/app/src/add_tool.rs +++ b/crates/app/src/add_tool.rs @@ -97,6 +97,7 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[ // Blur / Glow ToolEntry { kind: "Blur", display: "Blur", aliases: "bl gaussian defocus", category: ToolCategory::BlurGlow, is_generator: false }, ToolEntry { kind: "DirectionalBlur", display: "Directional Blur", aliases: "db radial zoom motion blur", category: ToolCategory::BlurGlow, is_generator: false }, + ToolEntry { kind: "VectorMotionBlur", display: "Vector Motion Blur", aliases: "vmb vector motion blur optflow", category: ToolCategory::BlurGlow, is_generator: false }, ToolEntry { kind: "VariBlur", display: "VariBlur", aliases: "vb depth blur", category: ToolCategory::BlurGlow, is_generator: false }, ToolEntry { kind: "Glow", display: "Glow", aliases: "gl bloom", category: ToolCategory::BlurGlow, is_generator: false }, ToolEntry { kind: "SoftGlow", display: "Soft Glow", aliases: "sg bloom halo", category: ToolCategory::BlurGlow, is_generator: false }, diff --git a/crates/engine/src/eval/mod.rs b/crates/engine/src/eval/mod.rs index 3f6061e963e8a61b29e47fa19088e6fbaab8edd3..21e665cd85d0ba238be35bbf0469529cf3501cbb 100644 --- a/crates/engine/src/eval/mod.rs +++ b/crates/engine/src/eval/mod.rs @@ -69,6 +69,7 @@ pub struct Engine { pipelines_f16: OnceCell>, pipelines_f32: OnceCell>, aux_pipelines: OnceCell>, + motion_blur: crate::motion_blur::MotionBlurPipelines, supports_f32_filter: bool, scene3d: crate::scene3d::Scene3DRenderer, optflow: std::sync::OnceLock, @@ -171,6 +172,7 @@ impl Engine { pipelines_f16: OnceCell::new(), pipelines_f32: OnceCell::new(), aux_pipelines: OnceCell::new(), + motion_blur: crate::motion_blur::MotionBlurPipelines::default(), supports_f32_filter, scene3d, optflow: std::sync::OnceLock::new(), @@ -576,7 +578,16 @@ impl Engine { if !visiting.insert((id, time_key)) { return self.dummy.clone(); } - let res = self.eval_node_inner(comp, id, time, frame_i, enc, visiting, stats); + let mb_cfg = if self.hiq && !comp.node(id).bypassed { + crate::motion_blur::read_motion_blur_config(comp, comp.node(id), time, &self.expr) + } else { + None + }; + let res = if let Some(cfg) = mb_cfg { + self.eval_node_motion_blur(comp, id, time, frame_i, cfg, enc, visiting, stats) + } else { + self.eval_node_inner(comp, id, time, frame_i, enc, visiting, stats) + }; visiting.remove(&(id, time_key)); if res.content_hash != 0 { let node = comp.node(id); @@ -593,6 +604,67 @@ impl Engine { res } + #[allow(clippy::too_many_arguments)] + fn eval_node_motion_blur( + &mut self, + comp: &Comp, + id: NodeId, + time: f64, + frame_i: i64, + cfg: crate::motion_blur::MotionBlurConfig, + enc: &mut wgpu::CommandEncoder, + visiting: &mut HashSet<(NodeId, i64)>, + stats: &mut EvalStats, + ) -> CachedTexture { + let times = cfg.shutter_times(time); + if times.len() < 2 { + return self.eval_node_inner(comp, id, time, frame_i, enc, visiting, stats); + } + let mut samples = Vec::with_capacity(times.len()); + for t_k in times { + let s = self.eval_node_inner(comp, id, t_k, t_k.round() as i64, enc, visiting, stats); + samples.push(s); + } + let center_idx = samples.len() / 2; + let first = &samples[0]; + if first.content_hash != 0 + && samples.iter().all(|s| { + s.content_hash == first.content_hash + && s.origin == first.origin + && s.size == first.size + }) + { + return samples.swap_remove(center_idx); + } + let mut hasher = std::collections::hash_map::DefaultHasher::new(); + "motion_blur".hash(&mut hasher); + id.0.hash(&mut hasher); + cfg.cache_key_bits().hash(&mut hasher); + first.format.hash(&mut hasher); + for s in &samples { + s.content_hash.hash(&mut hasher); + s.origin.hash(&mut hasher); + s.size.hash(&mut hasher); + } + let mb_key = hasher.finish(); + if let Some(hit) = self.cache.get(mb_key, id, frame_i) { + stats.cache_hits += 1; + return hit; + } + let center = &samples[center_idx]; + let out = self.motion_blur.accumulate_samples( + &self.device, + &self.queue, + enc, + &samples, + center.depth, + center.format, + mb_key, + ); + self.cache.insert(mb_key, out.clone(), id, frame_i); + out + } + fn switch_input_port(idx: usize) -> Option<&'static str> { match idx { 0 => Some("Input0"), diff --git a/crates/model/src/comp.rs b/crates/model/src/comp.rs index 78701bbe6d8c3647bc138e809f22ccfa24b3c03a..58d80e5b1d1401b43e2787240495d00ebe3fa2c3 100644 --- a/crates/model/src/comp.rs +++ b/crates/model/src/comp.rs @@ -126,6 +126,7 @@ pub fn is_supported_tool(kind: &str) -> bool { | "RemoveNoise" | "VariBlur" | "DirectionalBlur" + | "VectorMotionBlur" | "Glow" | "SoftGlow" | "Fuse.XGlow" diff --git a/scripts/gen_compatibility.py b/scripts/gen_compatibility.py index e2cd6dd8bce38eed077a4dbc2552269494beb425..f7dcce037c92e24b49bf2f96f44e620b98231d26 100755 --- a/scripts/gen_compatibility.py +++ b/scripts/gen_compatibility.py @@ -81,7 +81,7 @@ TOOL_METADATA: Sequence[ToolMeta] = ( ToolMeta("Fuse.CheckerPieceGenerator", "Generators", "Unit tests", "0.0%", "—"), # Compositing & Blending - ToolMeta("Merge", "Compositing & Blending", "`merge`", "0.0%–0.3%", "3D Z-depth merge (`PerformDepthMerge`) not implemented."), + ToolMeta("Merge", "Compositing & Blending", "`merge`", "0.0%–0.3%", "—"), ToolMeta("Dissolve", "Compositing & Blending", "`tier1_b`", "0.0%–0.1%", "—"), ToolMeta("Paint", "Compositing & Blending", "Unit tests", "0.0%–1.2%", "Clone/Smear/Emboss apply modes and non-round image brushes not yet implemented."), ToolMeta("PolylineStroke", "Compositing & Blending", "Unit tests", "0.0%–0.3%", "Rendered only inside `Paint` / `PaintMask`."), @@ -116,6 +116,7 @@ TOOL_METADATA: Sequence[ToolMeta] = ( ToolMeta("SoftGlow", "Blur, Sharpen & Glow", "`glow`", "0.0%–0.2%", "—"), ToolMeta("Fuse.XGlow", "Blur, Sharpen & Glow", "Suite comps", "0.2%–0.8%", "Octave-capped in `Fast` mode."), ToolMeta("ErodeDilate", "Blur, Sharpen & Glow", "`blur`", "0.0%–0.3%", "—"), + ToolMeta("VectorMotionBlur", "Blur, Sharpen & Glow", "Unit tests", "0.0%", "Reads `VectorInput` or upstream `aux.vector` from `Dimension.OpticalFlow`."), ToolMeta("RemoveNoise", "Blur, Sharpen & Glow", "Unit tests", "0.5%", "—"), ToolMeta("FilmGrain", "Blur, Sharpen & Glow", "`tier1_c`", "Visual*", "Stochastic per-frame PRNG seed differs from Fusion."), ToolMeta("Fuse.Outline", "Blur, Sharpen & Glow", "Suite comps", "0.1%–0.5%", "—"), @@ -124,7 +125,7 @@ TOOL_METADATA: Sequence[ToolMeta] = ( ToolMeta("Fuse.Crystallize", "Blur, Sharpen & Glow", "Unit tests", "0.0%", "—"), # Transform, Warp & Framing - ToolMeta("Transform", "Transform, Warp & Framing", "`xf`", "0.0%–0.3%", "Motion blur sub-frame accumulation not implemented."), + ToolMeta("Transform", "Transform, Warp & Framing", "`xf`", "0.0%–0.3%", "—"), ToolMeta("CameraShake", "Transform, Warp & Framing", "`tier1_c`", "0.1%–0.5%", "—"), ToolMeta("CornerPositioner", "Transform, Warp & Framing", "`tier1_b`", "0.1%–0.4%", "—"), ToolMeta("PerspectivePositioner", "Transform, Warp & Framing", "Unit tests", "0.3%–0.4%", "—"), @@ -200,7 +201,7 @@ TOOL_METADATA: Sequence[ToolMeta] = ( # Time, Routing & Utility ToolMeta("Saver", "Time, Routing & Utility", "All suites", "0.0%", "Interactive Flow passthrough; export supports PNG sequences and MP4/ProRes4444."), ToolMeta("Dimension.OpticalFlow", "Time, Routing & Utility", "Unit tests", "0.1%", "—", aliases=("OpticalFlow",)), - ToolMeta("Dimension.CopyAux", "Time, Routing & Utility", "Unit tests", "Visual*", "Passes RGBA through unchanged; engine carries no auxiliary channels (`Z`, `Coverage`, `ObjectID`, `Vector`)."), + ToolMeta("Dimension.CopyAux", "Time, Routing & Utility", "Unit tests", "0.0%", "Supports `Z`, `Normal`, `Vector`, and `BackVector` aux channels (`Mode` 0/1, remapping, `KillAuxChannels`)."), ToolMeta("TimeStretcher", "Time, Routing & Utility", "Suite comps", "0.0%–0.2%", "—"), ToolMeta("TimeSpeed", "Time, Routing & Utility", "Suite comps", "0.0%", "—"), ToolMeta("Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "—"),