From 1dc70637bd562d921f9eee8db5ed22633a76a253 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Tue, 17 Nov 2026 16:05:29 +0530 Subject: [PATCH 1/4] #3466: Sharpen Amount takes After Effects' 0..4000 range The hard range was 0..500, so prop.set and the value editors clamped values After Effects accepts (its recorded valid range is 0..4000; the 0..100 slider and the default are unchanged). The engine range test now covers both ends through prop.set, undo/redo, save/reopen and projects saved with the old range, and the recorded-range guard no longer lists Sharpen as narrower. --- crates/aep/src/export/fx_defs.rs | 1 - crates/effects/src/misc.rs | 15 ++++++++++++++- crates/engine/src/tests/effect_ranges.rs | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/aep/src/export/fx_defs.rs b/crates/aep/src/export/fx_defs.rs index 338e00fc5..3c0c3a357 100644 --- a/crates/aep/src/export/fx_defs.rs +++ b/crates/aep/src/export/fx_defs.rs @@ -729,7 +729,6 @@ mod tests { ("ec.obsolete.gaussianlegacy", "blurriness", 3463), ("ec.perspective.dropshadow", "softness", 3464), ("ec.blur.compound", "maximumBlur", 3465), - ("ec.blur.sharpen", "amount", 3466), ("ec.blur.radial", "amount", 3467), ("ec.blur.ccradial", "amount", 3468), ("ec.distort.turbulentdisplace", "amount", 3469), diff --git a/crates/effects/src/misc.rs b/crates/effects/src/misc.rs index 9c7131657..13167a3ba 100644 --- a/crates/effects/src/misc.rs +++ b/crates/effects/src/misc.rs @@ -794,7 +794,7 @@ pub fn specs() -> Vec { ], radial, ), - spec("ec.blur.sharpen", "Sharpen", "Blur & Sharpen", vec![p("amount", "Sharpen Amount", num(0.0), slider(0.0, 500.0, 0.0, 100.0, 0))], sharpen), + spec("ec.blur.sharpen", "Sharpen", "Blur & Sharpen", vec![p("amount", "Sharpen Amount", num(0.0), slider(0.0, 4000.0, 0.0, 100.0, 0))], sharpen), spec( "ec.blur.unsharp", "Unsharp Mask", @@ -1036,6 +1036,19 @@ mod tests { assert_ne!(row(2.0), row(2.4)); } + /// #3466: Sharpen Amount takes After Effects' valid range, 0..4000, and keeps its 0..100 + /// slider. `prop.set` and the value editors clamp to the hard range. + #[test] + fn sharpen_amount_takes_the_after_effects_range() { + let spec = crate::find("ec.blur.sharpen").unwrap(); + let ui = &spec.params.iter().find(|p| p.id == "amount").unwrap().ui; + assert!( + matches!(ui, ParamUi::Slider { min, max, slider_min, slider_max, .. } + if *min == 0.0 && *max == 4000.0 && *slider_min == 0.0 && *slider_max == 100.0), + "{ui:?}" + ); + } + #[test] fn fractional_box_blur_radius_is_continuous() { let row = |v| blurred_row("ec.blur.fastbox", "radius", v); diff --git a/crates/engine/src/tests/effect_ranges.rs b/crates/engine/src/tests/effect_ranges.rs index 7deaaa911..f2ad2112e 100644 --- a/crates/engine/src/tests/effect_ranges.rs +++ b/crates/engine/src/tests/effect_ranges.rs @@ -60,6 +60,7 @@ const ROWS: &[(u32, &str, &str, f64, f64)] = &[ (3471, "ec.distort.transform", "scaleHeight", -30000.0, 30000.0), (3471, "ec.distort.transform", "scaleWidth", -30000.0, 30000.0), (3470, "ec.distort.turbulentdisplace", "evolutionOptions/randomSeed", 0.0, 100000.0), + (3466, "ec.blur.sharpen", "amount", 0.0, 4000.0), ]; fn path(effect: &str, param: &str) -> String { From 1a4697de31ac2fc49174a92ffe0cf7fac78b40a2 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Tue, 17 Nov 2026 16:05:37 +0530 Subject: [PATCH 2/4] #3466: test Sharpen's render at Amount 4000 At the top of the new range the CPU render stays linear in Amount (colour moves Amount / 50 of its difference from the blur) and finite on 32 bpc over-range input, and the GPU matches the CPU at 8 and 32 bpc. --- crates/effects/src/misc.rs | 30 ++++++++++++++++++++++++++++++ crates/gpu/src/tests/fx_noise.rs | 2 ++ 2 files changed, 32 insertions(+) diff --git a/crates/effects/src/misc.rs b/crates/effects/src/misc.rs index 13167a3ba..351460de7 100644 --- a/crates/effects/src/misc.rs +++ b/crates/effects/src/misc.rs @@ -1049,6 +1049,36 @@ mod tests { ); } + /// #3466: at the new top of the range the render stays linear in Amount and finite on 32 bpc + /// over-range input: colour moves away from the blur by Amount / 50 of the difference + /// (2000 → 4000 doubles it), never below 0, and alpha is untouched. + #[test] + fn sharpen_is_linear_and_finite_up_to_amount_4000() { + let mut img = edge(); + for y in 0..8 { + for x in 0..20 { + img.set(x, y, [1000.0, 1000.0, 1000.0, 1.0]); + } + } + let sharpen = |a: f64| run_fx("ec.blur.sharpen", &[("amount", num(a))], img.clone(), 0.0, EffectEnv::default()).img; + let (half, top) = (sharpen(2000.0), sharpen(4000.0)); + for y in 0..8 { + for x in 0..40 { + let (i, h, t) = (img.get(x, y), half.get(x, y), top.get(x, y)); + assert_eq!(t[3], i[3], "alpha at {x}"); + for c in 0..3 { + assert!(t[c].is_finite() && t[c] >= 0.0, "({x}, {y}): {t:?}"); + if t[c] > 0.0 && h[c] > 0.0 { + let (dh, dt) = (h[c] - i[c], t[c] - i[c]); + assert!((dt - 2.0 * dh).abs() <= 1e-3 * dt.abs().max(1.0), "({x}, {y}): {dh} {dt}"); + } + } + } + } + // The bright side of the edge moves 80 × its difference from the blur: far past 10 × the input. + assert!(top.get(19, 4)[0] > 1000.0 * 10.0, "{:?}", top.get(19, 4)); + } + #[test] fn fractional_box_blur_radius_is_continuous() { let row = |v| blurred_row("ec.blur.fastbox", "radius", v); diff --git a/crates/gpu/src/tests/fx_noise.rs b/crates/gpu/src/tests/fx_noise.rs index 006128c73..5e31e7e84 100644 --- a/crates/gpu/src/tests/fx_noise.rs +++ b/crates/gpu/src/tests/fx_noise.rs @@ -75,6 +75,8 @@ fn edge_preserving_blurs() { fn sharpen_and_unsharp_mask() { effect_case("ec.blur.sharpen", &[("amount", n(60.0))]); effect_case("ec.blur.sharpen", &[("amount", n(250.0))]); + // #3466: the top of After Effects' range (80 × the difference from the blur). + effect_case("ec.blur.sharpen", &[("amount", n(4000.0))]); effect_case("ec.blur.unsharp", &[("amount", n(120.0)), ("radius", n(4.0))]); effect_case("ec.blur.unsharp", &[("amount", n(80.0)), ("radius", n(2.5)), ("threshold", n(12.0))]); } From 6c5d0b51ec482339c4b2739e508a386ff7044bb0 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Tue, 17 Nov 2026 16:05:37 +0530 Subject: [PATCH 3/4] #3466: note Sharpen's Amount range in the parity history --- docs/effects-parity.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/effects-parity.md b/docs/effects-parity.md index b07c624f8..d9bcfcedf 100644 --- a/docs/effects-parity.md +++ b/docs/effects-parity.md @@ -64,6 +64,7 @@ the GPU is performance, not parity. | Date | Change | Summary | |---|---|---| +| 2026-11-17 | minor | Sharpen: Amount takes After Effects' recorded valid range, 0..4000 (was 0..500; default and the 0..100 slider unchanged). Sharpen stays linear in Amount and finite up to 4000, CPU and GPU agree there | | 2026-11-12 | minor | Parameters take After Effects' recorded valid ranges (hard range; defaults and sliders unchanged): Levels (Individual Controls) levels −10000..10000 and Gamma from 0; 4-Color Gradient Blend to 10000 and Jitter to 500 %; Change Color Hue Transform ±1800°; Noise HLS (and Auto) amounts to 1000 % and Grain Size from 0; Grid Border to 2000; Venetian Blinds Width 1..32000 and Feather to 32000; Radial Wipe Feather to 32000; Scatter Amount to 1000; Beam thicknesses to 4000; Transform Scale ±30000 %; Turbulent Displace Random Seed to 100000. A test checks every mapped parameter's range against the recorded table (CPU and GPU) | | 2026-10-19 | minor | Glow (original colours): bright pass per channel, 8 × (value − threshold + 0.061), measured against After Effects 2026 (CPU and GPU) | | 2026-10-19 | minor | Glow (colour channels): the glow covers the layer's blurred alpha, blur σ = 0.384 × radius, measured against After Effects 2026 renders (CPU and GPU) | From 300fc48f1ed525cea854d329f003f2abef4699d3 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Tue, 17 Nov 2026 16:14:33 +0530 Subject: [PATCH 4/4] #3466: test Sharpen Amount clamps just outside 0..4000 prop.set of 4001 and -1 stores 4000 and 0, and undo/redo around the clamped set restore the values. --- crates/engine/src/tests/effect_ranges.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/engine/src/tests/effect_ranges.rs b/crates/engine/src/tests/effect_ranges.rs index f2ad2112e..b1c93ccb5 100644 --- a/crates/engine/src/tests/effect_ranges.rs +++ b/crates/engine/src/tests/effect_ranges.rs @@ -162,6 +162,23 @@ fn projects_saved_with_the_narrower_ranges_open_with_the_new_ones() { } } +/// #3466: Sharpen Amount clamps just outside After Effects' 0..4000, and an undo after a +/// clamped set restores the value from before it. +#[test] +fn sharpen_amount_clamps_outside_the_after_effects_range() { + let (mut s, l, _) = session(); + let (e, p) = ("ec.blur.sharpen", "amount"); + for (v, want) in [(4001.0, 4000.0), (-1.0, 0.0)] { + set(&mut s, l, e, p, 1000.0); + assert_eq!(set(&mut s, l, e, p, v), json!(want), "{v}: prop.set reply"); + assert_eq!(read(&mut s, l, e, p), want, "{v}"); + assert!(s.undo()); + assert_eq!(read(&mut s, l, e, p), 1000.0, "{v}: undo"); + assert!(s.redo()); + assert_eq!(read(&mut s, l, e, p), want, "{v}: redo"); + } +} + /// The property at `path` (`group/param`) in an effect instance. fn prop_mut<'a>(g: &'a mut PropGroup, path: &str) -> Option<&'a mut effectcraft_project::Property> { match path.split_once('/') {