authoravatarclover caruso<git@paperclover.net>2026-11-30 16:12:55-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-30 16:42:08-08:00
log3a881cf0f7794aa1acc31bd121ba60eba3e95b0a
treee81a7f6102c3691632a0a1c30bf542df99d49b9e
parente44c996f55a67e9dffeed9bfb8bc40dbdf33f6d1
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Implement Paint, PaintMask, PolylineStroke, Multistroke, and Dimension.CopyAux (#24)

Strokes are CPU-rasterized into one RGBA layer that is composited with the Merge shader (Paint) or post-processed through the shared mask path (PaintMask). Dimension.CopyAux passes RGBA through; the engine carries no aux planes. Assisted-by: claude-sonnet-5.5

6 files changed, 623 insertions(+), 64 deletions(-)

compatibility.md+13-8
......@@ -9,10 +9,10 @@ Auto-generated from live engine sources (`crates/engine/src/eval.rs`, `crates/en
99
1010| Metric | Value |
1111| --- | --- |
12| **Supported Flow Tools** | **110** (85 2D/Fuse/utility in `eval.rs`, 23 3D scene nodes in `scene3d.rs`, 2 Flow annotations) |
12| **Supported Flow Tools** | **115** (90 2D/Fuse/utility in `eval.rs`, 23 3D scene nodes in `scene3d.rs`, 2 Flow annotations) |
1313| **Modifiers & Animation** | **8** systems (9 Fusion modifier classes + Lua expressions) |
14| **Active Corpus (`trees/fusion`) Coverage** | **99.5%** (1,984 / 1,993 nodes across 16 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **99.4%** (54,635 / 54,955 nodes across 324 `.comp` files) |
14| **Active Corpus (`trees/fusion`) Coverage** | **99.7%** (1,988 / 1,993 nodes across 16 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (54,734 / 54,955 nodes across 324 `.comp` files) |
1616| **HiQ vs Fast Mode** | **`HiQ`**: honors `DepthFull` / generator `Depth` / `ChangeDepth` (`Rgba8Unorm`, clamped `Rgba16Float`, unclamped HDR `Rgba16Float`/`Rgba32Float`), full-res blurs & `XGlow`. **`Fast`**: collapses working targets to `Rgba8Unorm`, downsamples blurs, caps `XGlow` octaves for interactive scrubbing. |
1717
1818## Generators
......@@ -31,6 +31,9 @@ Auto-generated from live engine sources (`crates/engine/src/eval.rs`, `crates/en
3131| --- | --- | --- | --- | --- |
3232| `Merge` | `merge` | 0.0%–0.3% | 293 / 6358 | All ApplyModes (`Normal`, `Screen`, `Multiply`, `Difference`, `DarkerColor`, `Overlay`, `Hard/Soft/Linear/VividLight`, `LinearDodge`, etc.), `Operator=Over/Under`, `Gain`, `BurnIn`, `SubtractiveAdditive`, `Blend`, effect mask. |
3333| `Dissolve` | `tier1_b` | 0.0%–0.1% | 0 / 4 | Mix (`Mix = 0..1`) between `Background` and `Foreground` with effect mask support. |
34| `Paint` | Unit tests | Visual* | 0 / 25 | Composites the `Paint` stroke chain (`PolylineStroke` / `Multistroke`) over `Input` with `Blend` and `EffectMask`. CPU-rasterized round `CircleBrush` / `SoftBrush` (`Size`, `Softness`), `PaintApplyColor` (`Red`/`Green`/`Blue`/`Opacity`) and `PaintApplyErase` (erases earlier strokes). *Brush size/softness falloff are not Fusion-calibrated; `Clone` and other apply modes are skipped. |
35| `PolylineStroke` | Unit tests | Visual* | 0 / 27 | Bezier/linear `Polyline` (static or animated) with `WriteOnStart`/`WriteOnEnd`; always visible. Rendered only through `Paint` / `PaintMask`. |
36| `Multistroke` | Unit tests | Visual* | 0 / 33 | Recorded freehand `Strokes`, visible from `Time` for `Duration` frames (default 1) with per-stroke `Params` overrides (`ApplyMode`, `Size`, `Softness`, color, `Duration`). Per-point `T` is ignored. Rendered only through `Paint` / `PaintMask`. |
3437| `Shadow` | `tier1_b` | 0.1%–0.4% | 0 / 38 | Drop shadow offset, softness blur, tint color/alpha, and `ShadowOnly` output. |
3538
3639## Color & Depth
......@@ -101,6 +104,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval.rs`, `crates/en
101104| `PolylineMask` | `mask_softedge`, Suite comps | 0.1%–0.4% | 16 / 505 | CPU `zeno` Bezier/linear polygon rasterizer with animated keyframed `Polyline` splines, progressive-pyramid `SoftEdge`, `ClippingMode`, `Invert`, `PaintMode`. |
102105| `BitmapMask` | `mask_softedge` | 0.0%–0.2% | 3 / 121 | GPU image-to-mask extraction (`Alpha`/`Luminance`/`Red`/`Green`/`Blue`/`Saturation`/`Lightness`/`Hue`), `Low`/`High` clip, centered 1:1 alignment, `SoftEdge`, `Invert`, `Level`, `PaintMode`. |
103106| `WandMask` | `archive_3d` | 0.0%–0.3% | 0 / 150 | Seeded BFS flood-fill wand mask (`Source`, `SelectionPoint`, `SelectionRange`, `ColorSpace`, `SoftEdge`, `Invert`, `Level`, `PaintMode`). |
107| `PaintMask` | Unit tests | Visual* | 0 / 14 | Alpha mask of the `Paint` stroke chain (stroke opacity, erase), `MaskWidth`/`MaskHeight`, `SoftEdge`, `Filter`, `ClippingMode`, `Invert`, `Level`, `PaintMode` chaining. *Brush falloff is not Fusion-calibrated. |
104108
105109## 2D Vector Shapes
106110
......@@ -164,6 +168,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval.rs`, `crates/en
164168| --- | --- | --- | --- | --- |
165169| `Saver` | All suites | 0.0% | 15 / 278 | Output sink / passthrough in interactive Flow; Saver-driven pipelined PNG sequence export (`render-check --export` and `Cmd+Shift+R`). |
166170| `Dimension.OpticalFlow` | Unit tests | 0.1% | 2 / 10 | GPU 4-level pyramid coarse-to-fine bidirectional dense optical flow feeding downstream `TimeStretcher` flow interpolation. |
171| `Dimension.CopyAux` | Unit tests | Visual* | 4 / 0 | Passes the RGBA `Input` through unchanged in both `Mode`s. *The engine carries no auxiliary planes (`Z`, `Coverage`, `ObjectID`, `Vector`, ...), so `Channel` is ignored and aux-to-color output is not produced. |
167172| `TimeStretcher` | Suite comps | 0.0%–0.2% | 13 / 82 | Keyframed/expression `SourceTime` remapping with `Nearest` (`0`), `Blend` (`1`), and GPU `OpticalFlow` (`2`) bidirectional warped interpolation. |
168173| `TimeSpeed` | Suite comps | 0.0% | 0 / 166 | Constant/animated `Speed` and `Delay` time remapping. |
169174| `Switch` | Suite comps | 0.0% | 2 / 23 | Dynamic input routing by `Which` index (`Input1`..`InputN`). |
......@@ -199,16 +204,11 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
199204| `SurfaceTracker` | 2 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
200205| `MagicMask` | 3 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
201206| `PlanarTracker` | 0 / 0 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
202| `Dimension.CopyAux` | 4 / 0 | — | Preserved lossless on save; passes through main image input. |
203| `Multistroke` | 0 / 33 | — | Preserved lossless on save; passes through main input in Flow. |
204| `PolylineStroke` | 0 / 27 | — | Preserved lossless on save; passes through main input in Flow. |
205| `Paint` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |
206207| `Fuse.HexagonTiles` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |
207208| `AudioDisplay` | 0 / 21 | — | Preserved lossless on save; passes through main input in Flow. |
208209| `Fuse.AlphaWeightedNoise` | 0 / 21 | — | Preserved lossless on save; passes through main input in Flow. |
209210| `Fuse.Hexagon` | 0 / 17 | — | Preserved lossless on save; passes through main input in Flow. |
210211| `DaySky` | 0 / 16 | — | Preserved lossless on save; passes through main input in Flow. |
211| `PaintMask` | 0 / 14 | — | Preserved lossless on save; passes through main input in Flow. |
212212| `SurfaceAlembicMesh` | 0 / 13 | — | Preserved lossless on save; passes through main input in Flow. |
213213| `PseudoColor` | 0 / 6 | — | Preserved lossless on save; passes through main input in Flow. |
214214| `Fuse.CheckerPieceGenerator` | 0 / 6 | — | Preserved lossless on save; passes through main input in Flow. |
......@@ -220,6 +220,11 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
220220| `sGrid` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
221221| `DepthBlur` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
222222| `Replicate3D` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
223| `SphereMap` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
224| `RemoveNoise` | 0 / 3 | — | Preserved lossless on save; passes through main input in Flow. |
225| `RankFilter` | 0 / 3 | — | Preserved lossless on save; passes through main input in Flow. |
226| `AcesTransform` | 0 / 3 | — | Preserved lossless on save; passes through main input in Flow. |
227| `Bender3D` | 0 / 2 | — | Preserved lossless on save; passes through main input in Flow. |
223228
224229---
225230
crates/engine/src/eval/masks.rs+79-53
......@@ -1,5 +1,16 @@
11use super::*;
22
3/// GPU post-processing applied to a CPU-rasterized mask.
4pub(super) struct MaskPost<'a> {
5 pub soft_px: f32,
6 pub is_box: bool,
7 pub clamp_edges: f32,
8 pub paint_mode: f32,
9 pub invert: bool,
10 pub level: f32,
11 pub prev: Option<&'a CachedTexture>,
12}
13
314impl Engine {
415 pub(super) fn paint_mode_id(node: &Node) -> f32 {
516 match node.static_str("PaintMode").unwrap_or("Merge") {
......@@ -178,15 +189,7 @@ impl Engine {
178189 visiting: &mut HashSet<(NodeId, i64)>,
179190 stats: &mut EvalStats,
180191 ) -> CachedTexture {
181 let has_explicit_w = node.inputs.contains_key("MaskWidth");
182 let has_explicit_h = node.inputs.contains_key("MaskHeight");
183 let size = if has_explicit_w || has_explicit_h {
184 let w = comp.eval_number(node, "MaskWidth", time, comp.width as f64, &self.expr) as u32;
185 let h = comp.eval_number(node, "MaskHeight", time, comp.height as f64, &self.expr) as u32;
186 if w >= 16 && h >= 16 { self.scaled_dims(w, h) } else { comp_dims }
187 } else {
188 self.mask_target_size.unwrap_or(comp_dims)
189 };
192 let size = self.explicit_mask_size(comp, node, time, comp_dims);
190193 let center = comp.eval_point(node, "Center", time, [0.5, 0.5], &self.expr);
191194 let soft = comp.eval_number(node, "SoftEdge", time, 0.0, &self.expr).max(0.0) as f32;
192195 let invert = comp.eval_number(node, "Invert", time, 0.0, &self.expr) > 0.5;
......@@ -197,27 +200,7 @@ impl Engine {
197200 let prev_hash = prev_mask.as_ref().map_or(0, |m| m.content_hash);
198201 let paint_mode = Self::paint_mode_id(node);
199202
200 let evaluated_pts: Vec<model::PolyPoint>;
201 let points: &[model::PolyPoint] = if let Some(src) = node.connected_node("Polyline") {
202 if let Some(pts) = comp.eval_polyline_spline(src, time) {
203 evaluated_pts = pts;
204 &evaluated_pts
205 } else if let Some(pp) = comp.poly_paths.get(src) {
206 pp.points.as_slice()
207 } else {
208 &[]
209 }
210 } else if let Some(pl_tbl) = node
211 .raw
212 .get_table("Inputs")
213 .and_then(|i| i.get_table("Polyline").or_else(|| i.get_table("PolyLine")))
214 .and_then(|p| p.get_table("Value"))
215 {
216 evaluated_pts = model::PolyPath::parse_polyline_table(pl_tbl).1;
217 &evaluated_pts
218 } else {
219 &[]
220 };
203 let points = Self::polyline_points(comp, node, time);
221204
222205 let mut hash_floats = Vec::with_capacity(8 + points.len() * 6);
223206 hash_floats.extend_from_slice(&[
......@@ -230,7 +213,7 @@ impl Engine {
230213 if is_box { 1.0 } else { 0.0 },
231214 clamp_edges,
232215 ]);
233 for p in points {
216 for p in &points {
234217 hash_floats.extend_from_slice(&[p.x as f32, p.y as f32, p.lx as f32, p.ly as f32, p.rx as f32, p.ry as f32]);
235218 }
236219 let key = self.make_key(node, "PolylineMask", size, &[prev_hash], &hash_floats);
......@@ -245,40 +228,83 @@ impl Engine {
245228 let need_post = soft_px >= 0.5 || prev_mask.is_some();
246229 let pixels = rasterize_polyline_mask(
247230 size,
248 points,
231 &points,
249232 [center[0] as f32, center[1] as f32],
250233 if need_post { false } else { invert },
251234 if need_post { 1.0 } else { level },
252235 );
253 let raw_tex = create_texture(&self.device, size, if need_post { 0 } else { key });
236 let post = need_post.then_some(MaskPost {
237 soft_px,
238 is_box,
239 clamp_edges,
240 paint_mode,
241 invert,
242 level,
243 prev: prev_mask.as_ref(),
244 });
245 let tex = self.upload_cpu_mask(enc, size, key, &pixels, post);
246 self.cache.insert(key, tex.clone(), node.id, frame_i);
247 tex
248 }
249
250 /// Mask size from explicit `MaskWidth`/`MaskHeight`, else the inherited target size, else the comp's.
251 pub(super) fn explicit_mask_size(&self, comp: &Comp, node: &Node, time: f64, comp_dims: [u32; 2]) -> [u32; 2] {
252 if node.inputs.contains_key("MaskWidth") || node.inputs.contains_key("MaskHeight") {
253 let w = comp.eval_number(node, "MaskWidth", time, comp.width as f64, &self.expr) as u32;
254 let h = comp.eval_number(node, "MaskHeight", time, comp.height as f64, &self.expr) as u32;
255 if w >= 16 && h >= 16 {
256 return self.scaled_dims(w, h);
257 }
258 return comp_dims;
259 }
260 self.mask_target_size.unwrap_or(comp_dims)
261 }
262
263 /// Control points of `node`'s `Polyline` input: animated spline, `PolyPath` modifier, or inline value.
264 pub(super) fn polyline_points(comp: &Comp, node: &Node, time: f64) -> Vec<model::PolyPoint> {
265 if let Some(src) = node.connected_node("Polyline") {
266 if let Some(pts) = comp.eval_polyline_spline(src, time) {
267 return pts;
268 }
269 return comp.poly_paths.get(src).map(|pp| pp.points.clone()).unwrap_or_default();
270 }
271 node.raw
272 .get_table("Inputs")
273 .and_then(|i| i.get_table("Polyline").or_else(|| i.get_table("PolyLine")))
274 .and_then(|p| p.get_table("Value"))
275 .map(|t| model::PolyPath::parse_polyline_table(t).1)
276 .unwrap_or_default()
277 }
278
279 /// Uploads CPU-rasterized RGBA8 mask `pixels`; with `post`, applies `SoftEdge`, `Invert`, `Level`
280 /// and `PaintMode` chaining against the previous mask on the GPU.
281 pub(super) fn upload_cpu_mask(
282 &self,
283 enc: &mut wgpu::CommandEncoder,
284 size: [u32; 2],
285 key: u64,
286 pixels: &[u8],
287 post: Option<MaskPost>,
288 ) -> CachedTexture {
289 let raw_tex = create_texture(&self.device, size, if post.is_some() { 0 } else { key });
254290 self.queue.write_texture(
255291 raw_tex.texture.as_image_copy(),
256 &pixels,
292 pixels,
257293 wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(size[0] * 4), rows_per_image: Some(size[1]) },
258294 wgpu::Extent3d { width: size[0], height: size[1], depth_or_array_layers: 1 },
259295 );
260 let tex = if need_post {
261 let blurred = if soft_px >= 0.5 {
262 self.blur_mask_texture(enc, &raw_tex, soft_px, is_box, clamp_edges)
263 } else {
264 raw_tex
265 };
266 let combined = create_texture(&self.device, size, key);
267 let mut u = UniformParams::default();
268 u.p[0] = [
269 paint_mode,
270 if invert { 1.0 } else { 0.0 },
271 level,
272 if prev_mask.is_some() { 1.0 } else { 0.0 },
273 ];
274 let mv = prev_mask.as_ref().map_or(&self.dummy.view, |m| &m.view);
275 self.dispatch_op(enc, ShaderOp::MaskCombine, &blurred.view, &self.dummy.view, mv, &combined, &u);
276 combined
296 let Some(p) = post else { return raw_tex };
297 let blurred = if p.soft_px >= 0.5 {
298 self.blur_mask_texture(enc, &raw_tex, p.soft_px, p.is_box, p.clamp_edges)
277299 } else {
278300 raw_tex
279301 };
280 self.cache.insert(key, tex.clone(), node.id, frame_i);
281 tex
302 let combined = create_texture(&self.device, size, key);
303 let mut u = UniformParams::default();
304 u.p[0] = [p.paint_mode, if p.invert { 1.0 } else { 0.0 }, p.level, if p.prev.is_some() { 1.0 } else { 0.0 }];
305 let mv = p.prev.map_or(&self.dummy.view, |m| &m.view);
306 self.dispatch_op(enc, ShaderOp::MaskCombine, &blurred.view, &self.dummy.view, mv, &combined, &u);
307 combined
282308 }
283309
284310 #[allow(clippy::too_many_arguments)]
crates/engine/src/eval/mod.rs+12-2
......@@ -18,6 +18,7 @@ mod color;
1818mod blur_glow;
1919mod keyers;
2020mod masks;
21mod paint;
2122mod shapes_warp;
2223mod text_3d;
2324
......@@ -932,7 +933,7 @@ impl Engine {
932933 let frame_i = time.round() as i64;
933934 let is_mask_node = matches!(
934935 comp.node(id).kind.as_str(),
935 "EllipseMask" | "RectangleMask" | "PolylineMask"
936 "EllipseMask" | "RectangleMask" | "PolylineMask" | "PaintMask"
936937 );
937938 let memo_sz = if is_mask_node { self.mask_target_size } else { None };
938939 // Always memoize within a single frame's DAG pass so diamond graphs never explode
......@@ -967,7 +968,13 @@ impl Engine {
967968 if node.bypassed
968969 || matches!(
969970 node.kind.as_str(),
970 "Saver" | "PipeRouter" | "Fuse.Wireless" | "Tracker" | "Dimension.OpticalFlow" | "OpticalFlow"
971 "Saver"
972 | "PipeRouter"
973 | "Fuse.Wireless"
974 | "Tracker"
975 | "Dimension.OpticalFlow"
976 | "OpticalFlow"
977 | "Dimension.CopyAux"
971978 )
972979 {
973980 let port = default_main_input_port(&node.kind);
......@@ -1119,6 +1126,9 @@ impl Engine {
11191126 "EllipseMask" => self.eval_mask_shape(comp, node, time, frame_i, comp_dims, 0, enc, visiting, stats),
11201127 "RectangleMask" => self.eval_mask_shape(comp, node, time, frame_i, comp_dims, 1, enc, visiting, stats),
11211128 "PolylineMask" => self.eval_polyline_mask(comp, node, time, frame_i, comp_dims, enc, visiting, stats),
1129 "Paint" => self.eval_paint(comp, node, time, frame_i, comp_dims, enc, visiting, stats),
1130 "PaintMask" => self.eval_paint_mask(comp, node, time, frame_i, comp_dims, enc, visiting, stats),
1131 "PolylineStroke" | "Multistroke" => self.dummy.clone(),
11221132 "BitmapMask" => self.eval_bitmap_mask(comp, node, time, frame_i, comp_dims, enc, visiting, stats),
11231133 "WandMask" => self.eval_wand_mask(comp, node, time, frame_i, comp_dims, enc, visiting, stats),
11241134 "TextPlus" => self.eval_text_plus(comp, node, time, frame_i, comp_dims, enc, stats),
crates/engine/src/eval/paint.rs created+509
......@@ -0,0 +1,509 @@
1//! Fusion `Paint` / `PaintMask`: `PolylineStroke` and `Multistroke` chains are CPU-rasterized
2//! into one RGBA layer that the GPU then composites (`Paint`) or post-processes as a mask (`PaintMask`).
3
4use super::masks::MaskPost;
5use super::*;
6use model::{LuaTable, LuaValue, PolyPoint};
7
8/// Fusion stroke coordinates are centered on the image, Y-up, and normalized per axis.
9struct Stroke {
10 path: Vec<[f32; 2]>,
11 write_on: [f32; 2],
12 /// Brush diameter as a fraction of image width.
13 size: f32,
14 softness: f32,
15 color: [f32; 3],
16 opacity: f32,
17 erase: bool,
18}
19
20impl Stroke {
21 fn hash_into(&self, out: &mut Vec<f32>) {
22 out.extend_from_slice(&[self.write_on[0], self.write_on[1], self.size, self.softness, self.opacity]);
23 out.extend_from_slice(&self.color);
24 out.push(if self.erase { 1.0 } else { 0.0 });
25 out.push(self.path.len() as f32);
26 out.extend(self.path.iter().flatten());
27 }
28}
29
30const BEZIER_STEPS: usize = 24;
31
32fn flatten_polyline(points: &[PolyPoint]) -> Vec<[f32; 2]> {
33 let mut out: Vec<[f32; 2]> = points.first().map(|p| [p.x as f32, p.y as f32]).into_iter().collect();
34 for pair in points.windows(2) {
35 let (a, b) = (&pair[0], &pair[1]);
36 if a.linear && b.linear {
37 out.push([b.x as f32, b.y as f32]);
38 continue;
39 }
40 let p = [[a.x, a.y], [a.x + a.rx, a.y + a.ry], [b.x + b.lx, b.y + b.ly], [b.x, b.y]];
41 for k in 1..=BEZIER_STEPS {
42 let t = k as f64 / BEZIER_STEPS as f64;
43 let u = 1.0 - t;
44 let w = [u * u * u, 3.0 * u * u * t, 3.0 * u * t * t, t * t * t];
45 out.push([0, 1].map(|i| (0..4).map(|j| w[j] * p[j][i]).sum::<f64>() as f32));
46 }
47 }
48 out
49}
50
51fn fuid(v: &LuaValue) -> Option<&str> {
52 v.as_table()?.get_index(1)?.as_str()
53}
54
55/// Walks `head`'s `Paint` input chain and returns the strokes visible at `time`, oldest first.
56fn collect_strokes(comp: &Comp, head: &Node, time: f64, expr: &ExprEngine) -> Vec<Stroke> {
57 let mut chain: Vec<&Node> = Vec::new();
58 let mut next = head.connected_node("Paint");
59 while let Some(n) = next.and_then(|s| comp.find_node(s)).map(|id| comp.node(id)) {
60 if chain.iter().any(|c| c.id == n.id) {
61 break;
62 }
63 chain.push(n);
64 next = n.connected_node("Paint");
65 }
66
67 let mut strokes = Vec::new();
68 for node in chain.into_iter().rev().filter(|n| !n.bypassed) {
69 match node.kind.as_str() {
70 "PolylineStroke" => {
71 let path = flatten_polyline(&Engine::polyline_points(comp, node, time));
72 strokes.extend(stroke_style(comp, node, time, expr, None).map(|mut s| {
73 s.write_on = [
74 comp.eval_number(node, "WriteOnStart", time, 0.0, expr) as f32,
75 comp.eval_number(node, "WriteOnEnd", time, 1.0, expr) as f32,
76 ];
77 s.path = path;
78 s
79 }));
80 }
81 "Multistroke" => {
82 let Some(list) = node.raw.get_table("Strokes") else { continue };
83 for st in list.positional_values().filter_map(LuaValue::as_table) {
84 let params = st.get_table("Params");
85 let Some(mut s) = stroke_style(comp, node, time, expr, params) else { continue };
86 let start = st.get_f64("Time").unwrap_or(0.0);
87 let duration = stroke_number(comp, node, time, expr, params, "Duration", 1.0);
88 if time < start || time >= start + duration {
89 continue;
90 }
91 s.path = st
92 .positional_values()
93 .filter_map(LuaValue::as_table)
94 .map(|p| [p.get_f64("X").unwrap_or(0.0) as f32, p.get_f64("Y").unwrap_or(0.0) as f32])
95 .collect();
96 strokes.push(s);
97 }
98 }
99 _ => {}
100 }
101 }
102 strokes.retain(|s| !s.path.is_empty());
103 strokes
104}
105
106/// Per-stroke `Params` override the node's inputs of the same name.
107fn stroke_number(
108 comp: &Comp,
109 node: &Node,
110 time: f64,
111 expr: &ExprEngine,
112 params: Option<&LuaTable>,
113 key: &str,
114 default: f64,
115) -> f64 {
116 params
117 .and_then(|p| p.get_table(key))
118 .and_then(|t| t.get_f64("Value"))
119 .unwrap_or_else(|| comp.eval_number(node, key, time, default, expr))
120}
121
122/// Brush and apply-mode controls; `None` for apply modes this engine does not rasterize (e.g. `Clone`).
123fn stroke_style(
124 comp: &Comp,
125 node: &Node,
126 time: f64,
127 expr: &ExprEngine,
128 params: Option<&LuaTable>,
129) -> Option<Stroke> {
130 let num = |key: &str, default: f64| stroke_number(comp, node, time, expr, params, key, default) as f32;
131 let mode = params
132 .and_then(|p| p.get_table("ApplyMode")?.get("Value"))
133 .and_then(fuid)
134 .or_else(|| node.raw.get_table("ApplyModes")?.get_index(1)?.as_str())
135 .unwrap_or("PaintApplyColor");
136 let erase = match mode {
137 "PaintApplyColor" | "PaintApplyMerge" => false,
138 "PaintApplyErase" => true,
139 _ => return None,
140 };
141 let brush = node
142 .static_str("BrushShape")
143 .or_else(|| node.raw.get_table("Brushes")?.get_index(1)?.as_str())
144 .unwrap_or("SoftBrush");
145 Some(Stroke {
146 path: Vec::new(),
147 write_on: [0.0, 1.0],
148 size: num(&format!("{brush}.Size"), 0.01),
149 softness: if brush == "SoftBrush" { num("SoftBrush.Softness", 0.5).clamp(0.0, 1.0) } else { 0.0 },
150 color: [
151 num("PaintApplyColor.Red", 1.0),
152 num("PaintApplyColor.Green", 1.0),
153 num("PaintApplyColor.Blue", 1.0),
154 ],
155 opacity: num(&format!("{mode}.Opacity"), 1.0).clamp(0.0, 1.0),
156 erase,
157 })
158}
159
160/// Brush stamp positions along `path` (pixels) between the `write_on` fractions of its arclength.
161fn stamp_positions(path: &[[f32; 2]], write_on: [f32; 2], spacing: f32) -> Vec<[f32; 2]> {
162 let Some(&first) = path.first() else { return Vec::new() };
163 let [start, end] = write_on.map(|v| v.clamp(0.0, 1.0));
164 if end <= start {
165 return Vec::new();
166 }
167 let mut cum = vec![0.0f32];
168 for w in path.windows(2) {
169 cum.push(cum.last().unwrap() + (w[1][0] - w[0][0]).hypot(w[1][1] - w[0][1]));
170 }
171 let total = *cum.last().unwrap();
172 if total < 1e-4 {
173 return vec![first];
174 }
175 let (d0, d1) = (start * total, end * total);
176 let n = ((d1 - d0) / spacing).ceil() as usize;
177 (0..=n)
178 .map(|k| {
179 let d = (d0 + k as f32 * spacing).min(d1);
180 let i = cum.partition_point(|&c| c < d).clamp(1, path.len() - 1);
181 let t = (d - cum[i - 1]) / (cum[i] - cum[i - 1]).max(1e-6);
182 [0, 1].map(|a| path[i - 1][a] + (path[i][a] - path[i - 1][a]) * t)
183 })
184 .collect()
185}
186
187/// Coverage of a round brush of radius `r` at distance `d` from its center.
188fn brush_coverage(d: f32, r: f32, softness: f32) -> f32 {
189 if softness <= 0.0 {
190 return (r + 0.5 - d).clamp(0.0, 1.0);
191 }
192 let t = ((r - d) / (r * softness).max(1e-3)).clamp(0.0, 1.0);
193 t * t * (3.0 - 2.0 * t)
194}
195
196/// Rasterizes `strokes` in order into a premultiplied RGBA float layer, top row first.
197fn render_strokes(strokes: &[Stroke], [w, h]: [u32; 2]) -> Vec<[f32; 4]> {
198 let mut layer = vec![[0.0f32; 4]; (w * h) as usize];
199 for s in strokes {
200 let r = (s.size * w as f32 * 0.5).max(0.5);
201 let px: Vec<[f32; 2]> = s.path.iter().map(|p| [(0.5 + p[0]) * w as f32, (0.5 - p[1]) * h as f32]).collect();
202 let stamps = stamp_positions(&px, s.write_on, (r * 0.2).max(0.5));
203 let bounds = stamps.iter().fold([f32::MAX, f32::MAX, f32::MIN, f32::MIN], |b, p| {
204 [b[0].min(p[0]), b[1].min(p[1]), b[2].max(p[0]), b[3].max(p[1])]
205 });
206 let x0 = (bounds[0] - r - 1.0).floor().max(0.0) as u32;
207 let y0 = (bounds[1] - r - 1.0).floor().max(0.0) as u32;
208 let x1 = ((bounds[2] + r + 1.0).ceil().max(0.0) as u32).min(w);
209 let y1 = ((bounds[3] + r + 1.0).ceil().max(0.0) as u32).min(h);
210 if stamps.is_empty() || x0 >= x1 || y0 >= y1 {
211 continue;
212 }
213 let bw = (x1 - x0) as usize;
214 let mut cov = vec![0.0f32; bw * (y1 - y0) as usize];
215 for c in &stamps {
216 let (sx0, sx1) = (((c[0] - r - 1.0).floor().max(x0 as f32)) as u32, ((c[0] + r + 1.0).ceil().min(x1 as f32)) as u32);
217 let (sy0, sy1) = (((c[1] - r - 1.0).floor().max(y0 as f32)) as u32, ((c[1] + r + 1.0).ceil().min(y1 as f32)) as u32);
218 for y in sy0..sy1 {
219 for x in sx0..sx1 {
220 let d = (x as f32 + 0.5 - c[0]).hypot(y as f32 + 0.5 - c[1]);
221 let v = &mut cov[(y - y0) as usize * bw + (x - x0) as usize];
222 *v = v.max(brush_coverage(d, r, s.softness));
223 }
224 }
225 }
226 for y in y0..y1 {
227 for x in x0..x1 {
228 let a = cov[(y - y0) as usize * bw + (x - x0) as usize] * s.opacity;
229 let px = &mut layer[(y * w + x) as usize];
230 if s.erase {
231 px.iter_mut().for_each(|c| *c *= 1.0 - a);
232 } else {
233 let color = [s.color[0], s.color[1], s.color[2], 1.0];
234 for (c, k) in px.iter_mut().zip(color) {
235 *c = k * a + *c * (1.0 - a);
236 }
237 }
238 }
239 }
240 }
241 layer
242}
243
244fn to_rgba8(layer: &[[f32; 4]], map: impl Fn([f32; 4]) -> [f32; 4]) -> Vec<u8> {
245 layer.iter().flat_map(|&p| map(p).map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8)).collect()
246}
247
248impl Engine {
249 #[allow(clippy::too_many_arguments)]
250 pub(super) fn eval_paint(
251 &mut self,
252 comp: &Comp,
253 node: &Node,
254 time: f64,
255 frame_i: i64,
256 comp_dims: [u32; 2],
257 enc: &mut wgpu::CommandEncoder,
258 visiting: &mut HashSet<(NodeId, i64)>,
259 stats: &mut EvalStats,
260 ) -> CachedTexture {
261 let src = match node.connected_node("Input").and_then(|s| comp.find_node(s)) {
262 Some(id) => self.eval_node(comp, id, time, enc, visiting, stats),
263 None => self.alloc_tex(comp_dims, BitDepth::Int8, 0),
264 };
265 let blend = comp.eval_number(node, "Blend", time, 1.0, &self.expr) as f32;
266 let strokes = collect_strokes(comp, node, time, &self.expr);
267 if blend <= 1e-6 || strokes.is_empty() {
268 return src;
269 }
270 let src = self.crop_to_canvas(enc, src);
271 let (mask, mask_inv) = self.eval_mask_input_sized(comp, node, time, Some(src.size), enc, visiting, stats);
272 let mask_hash = mask.as_ref().map_or(0, |m| m.content_hash);
273
274 let mut params = vec![blend];
275 strokes.iter().for_each(|s| s.hash_into(&mut params));
276 let mut u = UniformParams::default();
277 u.p[0] = [0.5, 0.5, 1.0, 0.0];
278 u.p[1] = [blend, 1.0, 0.0, 0.0];
279 u.p[2] = [0.0, 0.0, 1.0, 0.0];
280 u.p[3] = [
281 if mask.is_some() { 1.0 } else { 0.0 },
282 if mask_inv { 1.0 } else { 0.0 },
283 src.size[0] as f32,
284 src.size[1] as f32,
285 ];
286 u.p[6] = [0.0, 1.0, 0.0, 0.0];
287 let key = self.make_key(node, "Paint", src.size, &[src.content_hash, mask_hash], &params);
288 if let Some(hit) = self.cache.get(key, node.id, frame_i) {
289 stats.cache_hits += 1;
290 return hit;
291 }
292 stats.cache_misses += 1;
293 stats.nodes_evaluated += 1;
294
295 let pixels = to_rgba8(&render_strokes(&strokes, src.size), |p| p);
296 let layer = create_texture(&self.device, src.size, 0);
297 self.queue.write_texture(
298 layer.texture.as_image_copy(),
299 &pixels,
300 wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(src.size[0] * 4), rows_per_image: Some(src.size[1]) },
301 wgpu::Extent3d { width: src.size[0], height: src.size[1], depth_or_array_layers: 1 },
302 );
303 let dst = self.alloc_tex_like(&src, src.depth, key);
304 let mv = mask.as_ref().map_or(&self.dummy.view, |m| &m.view);
305 self.dispatch_op(enc, ShaderOp::Merge, &src.view, &layer.view, mv, &dst, &u);
306 self.cache.insert(key, dst.clone(), node.id, frame_i);
307 dst
308 }
309
310 #[allow(clippy::too_many_arguments)]
311 pub(super) fn eval_paint_mask(
312 &mut self,
313 comp: &Comp,
314 node: &Node,
315 time: f64,
316 frame_i: i64,
317 comp_dims: [u32; 2],
318 enc: &mut wgpu::CommandEncoder,
319 visiting: &mut HashSet<(NodeId, i64)>,
320 stats: &mut EvalStats,
321 ) -> CachedTexture {
322 let size = self.explicit_mask_size(comp, node, time, comp_dims);
323 let soft = comp.eval_number(node, "SoftEdge", time, 0.0, &self.expr).max(0.0) as f32;
324 let invert = comp.eval_number(node, "Invert", time, 0.0, &self.expr) > 0.5;
325 let level = comp.eval_number(node, "Level", time, 1.0, &self.expr) as f32;
326 let is_box = Self::mask_filter_is_box(node);
327 let clamp_edges = Self::mask_clamp_edges(node);
328 let paint_mode = Self::paint_mode_id(node);
329 let (prev_mask, _) = self.eval_mask_input_sized(comp, node, time, Some(size), enc, visiting, stats);
330 let prev_hash = prev_mask.as_ref().map_or(0, |m| m.content_hash);
331 let strokes = collect_strokes(comp, node, time, &self.expr);
332
333 let mut params = vec![soft, invert as u8 as f32, level, paint_mode, is_box as u8 as f32, clamp_edges];
334 strokes.iter().for_each(|s| s.hash_into(&mut params));
335 let key = self.make_key(node, "PaintMask", size, &[prev_hash], &params);
336 if let Some(hit) = self.cache.get(key, node.id, frame_i) {
337 stats.cache_hits += 1;
338 return hit;
339 }
340 stats.cache_misses += 1;
341 stats.nodes_evaluated += 1;
342
343 let pixels = to_rgba8(&render_strokes(&strokes, size), |p| [p[3]; 4]);
344 let post = MaskPost {
345 soft_px: soft * size[0] as f32,
346 is_box,
347 clamp_edges,
348 paint_mode,
349 invert,
350 level,
351 prev: prev_mask.as_ref(),
352 };
353 let tex = self.upload_cpu_mask(enc, size, key, &pixels, Some(post));
354 self.cache.insert(key, tex.clone(), node.id, frame_i);
355 tex
356 }
357}
358
359#[cfg(test)]
360mod tests {
361 use super::*;
362 use crate::Engine;
363
364 const POLYLINE: &str = "Polyline = Input { Value = Polyline { Points = {
365 { Linear = true, X = -0.25, Y = 0.25, RX = 0.1, RY = 0 },
366 { Linear = true, X = 0.25, Y = 0.25, LX = -0.1, LY = 0 },
367 } }, },";
368
369 fn comp_src(tools: &str) -> String {
370 format!(
371 r#"Composition {{
372 CurrentTime = 0, RenderRange = {{ 0, 10 }}, GlobalRange = {{ 0, 10 }},
373 Tools = ordered() {{
374 BG = Background {{ Inputs = {{
375 Width = Input {{ Value = 64, }}, Height = Input {{ Value = 64, }},
376 TopLeftAlpha = Input {{ Value = 1.0, }},
377 }}, }},
378 {tools}
379 }}
380 }}"#
381 )
382 }
383
384 fn stroke(path: &[[f32; 2]], softness: f32, erase: bool) -> Stroke {
385 Stroke {
386 path: path.to_vec(),
387 write_on: [0.0, 1.0],
388 size: 0.2,
389 softness,
390 color: [1.0, 0.5, 0.0],
391 opacity: 1.0,
392 erase,
393 }
394 }
395
396 fn alpha_at(layer: &[[f32; 4]], x: u32, y: u32) -> f32 {
397 layer[(y * 64 + x) as usize][3]
398 }
399
400 #[test]
401 fn write_on_trims_stamps_by_arclength() {
402 let path = [[0.0, 10.0], [100.0, 10.0]];
403 let half = stamp_positions(&path, [0.0, 0.5], 5.0);
404 assert_eq!(half.first(), Some(&[0.0, 10.0]));
405 assert!((half.last().unwrap()[0] - 50.0).abs() < 1e-3);
406 assert!(stamp_positions(&path, [0.5, 0.5], 5.0).is_empty());
407 assert_eq!(stamp_positions(&[[3.0, 4.0], [3.0, 4.0]], [0.0, 1.0], 5.0), vec![[3.0, 4.0]]);
408 }
409
410 #[test]
411 fn soft_brush_falls_off_and_hard_brush_is_flat() {
412 let dot = [[0.0, 0.0]];
413 let hard = render_strokes(&[stroke(&dot, 0.0, false)], [64, 64]);
414 let soft = render_strokes(&[stroke(&dot, 1.0, false)], [64, 64]);
415 // radius = 0.2 * 64 / 2 = 6.4px around (32, 32)
416 assert_eq!(alpha_at(&hard, 32, 32), 1.0);
417 assert_eq!(alpha_at(&hard, 35, 32), 1.0);
418 assert_eq!(alpha_at(&hard, 40, 32), 0.0);
419 assert!(alpha_at(&soft, 32, 32) > 0.95);
420 let mid = alpha_at(&soft, 35, 32);
421 assert!(mid > 0.0 && mid < 1.0, "soft falloff {mid}");
422 assert!(alpha_at(&soft, 37, 32) < mid);
423 assert_eq!(hard[(32 * 64 + 32) as usize], [1.0, 0.5, 0.0, 1.0]);
424 }
425
426 #[test]
427 fn erase_removes_earlier_paint_only() {
428 let dot = [[0.0, 0.0]];
429 let layer = render_strokes(&[stroke(&dot, 0.0, false), stroke(&[[0.5, 0.0]], 0.0, true)], [64, 64]);
430 assert_eq!(alpha_at(&layer, 32, 32), 1.0);
431 let erased = render_strokes(&[stroke(&dot, 0.0, false), stroke(&dot, 0.0, true)], [64, 64]);
432 assert_eq!(erased[(32 * 64 + 32) as usize], [0.0; 4]);
433 }
434
435 #[test]
436 fn multistroke_is_visible_only_within_its_duration() {
437 let src = comp_src(
438 r#"Stroke = Multistroke {
439 Brushes = { "CircleBrush" },
440 ApplyModes = { "PaintApplyColor", "PaintApplyErase" },
441 Inputs = { BrushShape = Input { Value = FuID { "CircleBrush" }, }, },
442 Strokes = {
443 { Time = 4, { X = 0, Y = 0, T = 0 }, { X = 0.1, Y = 0, T = 5 } },
444 { Time = 6, Params = { Duration = { Value = 3 }, ApplyMode = { Value = FuID { "PaintApplyErase" } } },
445 { X = 0, Y = 0, T = 0 } },
446 { Time = 6, Params = { ApplyMode = { Value = FuID { "PaintApplyClone" } } }, { X = 0, Y = 0, T = 0 } },
447 },
448 },
449 Paint1 = Paint { Inputs = {
450 Input = Input { SourceOp = "BG", Source = "Output", },
451 Paint = Input { SourceOp = "Stroke", Source = "Out", },
452 }, },"#,
453 );
454 let comp = Comp::from_fusion_str(&src).expect("parse");
455 let expr = ExprEngine::new();
456 let paint = comp.node(comp.find_node("Paint1").unwrap());
457 let count = |t: f64| collect_strokes(&comp, paint, t, &expr).iter().map(|s| s.erase).collect::<Vec<_>>();
458 assert_eq!(count(3.0), Vec::<bool>::new());
459 assert_eq!(count(4.0), vec![false]);
460 assert_eq!(count(5.0), Vec::<bool>::new());
461 assert_eq!(count(7.0), vec![true]);
462 assert_eq!(count(9.0), Vec::<bool>::new());
463 }
464
465 #[test]
466 fn paint_composites_polyline_write_on_over_input() {
467 let src = comp_src(&format!(
468 r#"Stroke = PolylineStroke {{
469 Brushes = {{ "CircleBrush" }}, ApplyModes = {{ "PaintApplyColor" }},
470 Inputs = {{
471 BrushShape = Input {{ Value = FuID {{ "CircleBrush" }}, }},
472 ["CircleBrush.Size"] = Input {{ Value = 0.1, }},
473 WriteOnEnd = Input {{ Value = 0.5, }},
474 {POLYLINE}
475 }},
476 }},
477 Paint1 = Paint {{ Inputs = {{
478 Input = Input {{ SourceOp = "BG", Source = "Output", }},
479 Paint = Input {{ SourceOp = "Stroke", Source = "Out", }},
480 }}, }},
481 Mask1 = PaintMask {{ Inputs = {{
482 MaskWidth = Input {{ Value = 64, }}, MaskHeight = Input {{ Value = 64, }},
483 Paint = Input {{ SourceOp = "Stroke", Source = "Out", }},
484 }}, }},
485 Aux1 = Dimension.CopyAux {{ Inputs = {{
486 Input = Input {{ SourceOp = "BG", Source = "Output", }},
487 }}, }},"#
488 ));
489 let comp = Comp::from_fusion_str(&src).expect("parse");
490 let Ok(mut eng) = Engine::new_headless() else { return };
491 let mut read = |name: &str| {
492 let (tex, stats) = eng.evaluate(&comp, comp.find_node(name).unwrap(), 0.0);
493 assert!(stats.unsupported_nodes.is_empty(), "{:?}", stats.unsupported_nodes);
494 eng.readback_rgba(&tex).expect("readback")
495 };
496 let px = |img: &[u8], x: usize, y: usize| <[u8; 4]>::try_from(&img[(y * 64 + x) * 4..][..4]).unwrap();
497
498 let painted = read("Paint1");
499 assert_eq!(px(&painted, 20, 16), [255; 4], "written half is white");
500 assert_eq!(px(&painted, 44, 16), [0, 0, 0, 255], "un-written half stays input");
501 assert_eq!(px(&painted, 20, 48), [0, 0, 0, 255], "away from the stroke stays input");
502
503 let mask = read("Mask1");
504 assert_eq!(px(&mask, 20, 16), [255; 4]);
505 assert_eq!(px(&mask, 44, 16), [0; 4]);
506
507 assert_eq!(read("Aux1"), read("BG"), "CopyAux passes RGBA through");
508 }
509}
crates/model/src/comp.rs+5
......@@ -138,6 +138,10 @@ pub fn is_supported_tool(kind: &str) -> bool {
138138 | "PolylineMask"
139139 | "BitmapMask"
140140 | "WandMask"
141 | "Paint"
142 | "PaintMask"
143 | "PolylineStroke"
144 | "Multistroke"
141145 | "TextPlus"
142146 | "Fuse.Colorize"
143147 | "Fuse.Outline"
......@@ -145,6 +149,7 @@ pub fn is_supported_tool(kind: &str) -> bool {
145149 | "Fuse.Cryptomatte"
146150 | "Cryptomatte"
147151 | "Dimension.OpticalFlow"
152 | "Dimension.CopyAux"
148153 | "OpticalFlow"
149154 | "Custom"
150155 // Modifiers
scripts/gen_compatibility.py+5-1
......@@ -65,6 +65,9 @@ TOOL_METADATA: Sequence[ToolMeta] = (
6565 # Compositing & Blending
6666 ToolMeta("Merge", "Compositing & Blending", "`merge`", "0.0%–0.3%", "All ApplyModes (`Normal`, `Screen`, `Multiply`, `Difference`, `DarkerColor`, `Overlay`, `Hard/Soft/Linear/VividLight`, `LinearDodge`, etc.), `Operator=Over/Under`, `Gain`, `BurnIn`, `SubtractiveAdditive`, `Blend`, effect mask."),
6767 ToolMeta("Dissolve", "Compositing & Blending", "`tier1_b`", "0.0%–0.1%", "Mix (`Mix = 0..1`) between `Background` and `Foreground` with effect mask support."),
68 ToolMeta("Paint", "Compositing & Blending", "Unit tests", "Visual*", "Composites the `Paint` stroke chain (`PolylineStroke` / `Multistroke`) over `Input` with `Blend` and `EffectMask`. CPU-rasterized round `CircleBrush` / `SoftBrush` (`Size`, `Softness`), `PaintApplyColor` (`Red`/`Green`/`Blue`/`Opacity`) and `PaintApplyErase` (erases earlier strokes). *Brush size/softness falloff are not Fusion-calibrated; `Clone` and other apply modes are skipped."),
69 ToolMeta("PolylineStroke", "Compositing & Blending", "Unit tests", "Visual*", "Bezier/linear `Polyline` (static or animated) with `WriteOnStart`/`WriteOnEnd`; always visible. Rendered only through `Paint` / `PaintMask`."),
70 ToolMeta("Multistroke", "Compositing & Blending", "Unit tests", "Visual*", "Recorded freehand `Strokes`, visible from `Time` for `Duration` frames (default 1) with per-stroke `Params` overrides (`ApplyMode`, `Size`, `Softness`, color, `Duration`). Per-point `T` is ignored. Rendered only through `Paint` / `PaintMask`."),
6871 ToolMeta("Shadow", "Compositing & Blending", "`tier1_b`", "0.1%–0.4%", "Drop shadow offset, softness blur, tint color/alpha, and `ShadowOnly` output."),
6972
7073 # Color & Depth
......@@ -120,6 +123,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
120123 ToolMeta("PolylineMask", "Masks", "`mask_softedge`, Suite comps", "0.1%–0.4%", "CPU `zeno` Bezier/linear polygon rasterizer with animated keyframed `Polyline` splines, progressive-pyramid `SoftEdge`, `ClippingMode`, `Invert`, `PaintMode`."),
121124 ToolMeta("BitmapMask", "Masks", "`mask_softedge`", "0.0%–0.2%", "GPU image-to-mask extraction (`Alpha`/`Luminance`/`Red`/`Green`/`Blue`/`Saturation`/`Lightness`/`Hue`), `Low`/`High` clip, centered 1:1 alignment, `SoftEdge`, `Invert`, `Level`, `PaintMode`."),
122125 ToolMeta("WandMask", "Masks", "`archive_3d`", "0.0%–0.3%", "Seeded BFS flood-fill wand mask (`Source`, `SelectionPoint`, `SelectionRange`, `ColorSpace`, `SoftEdge`, `Invert`, `Level`, `PaintMode`)."),
126 ToolMeta("PaintMask", "Masks", "Unit tests", "Visual*", "Alpha mask of the `Paint` stroke chain (stroke opacity, erase), `MaskWidth`/`MaskHeight`, `SoftEdge`, `Filter`, `ClippingMode`, `Invert`, `Level`, `PaintMode` chaining. *Brush falloff is not Fusion-calibrated."),
123127
124128 # 2D Vector Shapes
125129 ToolMeta("sRender", "2D Vector Shapes", "Unit tests", "0.0%", "Antialiased `zeno` 2D vector shape tree rasterizer (`Width`, `Height`, `Blend`, `EffectMask`, cached RGBA upload & `HiQ` depth promotion)."),
......@@ -171,6 +175,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
171175 # Time, Routing & Utility
172176 ToolMeta("Saver", "Time, Routing & Utility", "All suites", "0.0%", "Output sink / passthrough in interactive Flow; Saver-driven pipelined PNG sequence export (`render-check --export` and `Cmd+Shift+R`)."),
173177 ToolMeta("Dimension.OpticalFlow", "Time, Routing & Utility", "Unit tests", "0.1%", "GPU 4-level pyramid coarse-to-fine bidirectional dense optical flow feeding downstream `TimeStretcher` flow interpolation.", aliases=("OpticalFlow",)),
178 ToolMeta("Dimension.CopyAux", "Time, Routing & Utility", "Unit tests", "Visual*", "Passes the RGBA `Input` through unchanged in both `Mode`s. *The engine carries no auxiliary planes (`Z`, `Coverage`, `ObjectID`, `Vector`, ...), so `Channel` is ignored and aux-to-color output is not produced."),
174179 ToolMeta("TimeStretcher", "Time, Routing & Utility", "Suite comps", "0.0%–0.2%", "Keyframed/expression `SourceTime` remapping with `Nearest` (`0`), `Blend` (`1`), and GPU `OpticalFlow` (`2`) bidirectional warped interpolation."),
175180 ToolMeta("TimeSpeed", "Time, Routing & Utility", "Suite comps", "0.0%", "Constant/animated `Speed` and `Delay` time remapping."),
176181 ToolMeta("Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Dynamic input routing by `Which` index (`Input1`..`InputN`)."),
......@@ -218,7 +223,6 @@ UNSUPPORTED_NOTES: Sequence[UnsupportedMeta] = (
218223 UnsupportedMeta("SurfaceTracker", "Preserved lossless on save; passes through main image input in Flow.", 7),
219224 UnsupportedMeta("MagicMask", "Preserved lossless on save; passes through main image input in Flow.", 7),
220225 UnsupportedMeta("PlanarTracker", "Preserved lossless on save; passes through main image input in Flow.", 7),
221 UnsupportedMeta("Dimension.CopyAux", "Preserved lossless on save; passes through main image input.", None),
222226)
223227
224228