mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-19 16:45:28 +00:00
#3464: Drop Shadow: test a huge Softness; say what the GPU test checks
A Softness far past the range (an expression can set one) overflowed the padding's u32 before drop_shadow_pad saturated it; the new test panicked there in a debug build and renders a finite shadow now. The GPU test's comment and the parity row now say that a cut margin renders on the CPU, and the CPU test quotes the measured 0.11 at Softness 8000.
This commit is contained in:
3 files changed
+16
-5
No files matched your search
@@ -1058,10 +1058,21 @@ mod tests {
|
||||
assert_eq!(*ui, slider(0.0, 30000.0, 0.0, 250.0, 1));
|
||||
}
|
||||
|
||||
/// #3464: a Softness far past the range (an expression can set one) used to overflow the
|
||||
/// padding's `u32` (a panic in debug builds). It renders, finite.
|
||||
#[test]
|
||||
fn drop_shadow_takes_a_huge_softness() {
|
||||
for softness in [1e12, f64::INFINITY] {
|
||||
let layer = effectcraft_raster::Image::filled(8, 8, [1.0, 1.0, 1.0, 1.0]);
|
||||
let out = run_fx("ec.perspective.dropshadow", &[("softness", num(softness))], layer, 0.0, EffectEnv::default());
|
||||
assert!(out.img.data.iter().flatten().all(|v| v.is_finite()), "softness {softness}");
|
||||
}
|
||||
}
|
||||
|
||||
/// #3464: past the padding budget (#2261) the shadow keeps its whole blur (σ = Softness / 2)
|
||||
/// up to the buffer's edge. A 64 × 48 layer's shadow at its centre is the Gaussian's share
|
||||
/// of the layer, less the 6 % three boxes' peak is under a Gaussian's; dropping what the
|
||||
/// boxes spread past the buffer left it at 0.2 of that at 8000 and 0.001 at 30000.
|
||||
/// boxes spread past the buffer left it at 0.11 of that at 8000.
|
||||
#[test]
|
||||
fn drop_shadow_keeps_its_blur_past_the_padding_budget() {
|
||||
let (w, h) = (64u32, 48u32);
|
||||
|
||||
@@ -761,9 +761,9 @@ fn box_blur_horizontal_rows_match_cpu_beyond_256() {
|
||||
}
|
||||
|
||||
/// #3464: Drop Shadow's Softness reaches 30000. While the padded buffer holds the blur the GPU
|
||||
/// runs it (1000, the old maximum, on a 70 × 44 layer); once the pixel budget cuts the padding
|
||||
/// the CPU blurs past the buffer's edge, so the GPU hands the effect over and the render still
|
||||
/// matches, with and without Shadow Only.
|
||||
/// runs it and matches the CPU (1000, the old maximum, on a 70 × 44 layer). Once the pixel
|
||||
/// budget cuts the padding only the CPU blurs past the buffer's edge, so the GPU declines the
|
||||
/// effect; the render then takes it on the CPU at 8 and 32 bpc, with and without Shadow Only.
|
||||
#[test]
|
||||
fn drop_shadow_large_softness_matches_cpu() {
|
||||
effect_case("ec.perspective.dropshadow", &[("distance", n(6.0)), ("softness", n(1000.0)), ("opacity", n(100.0))]);
|
||||
|
||||
@@ -64,7 +64,7 @@ the GPU is performance, not parity.
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-17 | minor | Drop Shadow: Softness takes After Effects' recorded valid range, 0..30000 (default and 0..250 slider unchanged). Past the padding budget the shadow keeps its blur (σ = Softness / 2) and is cut at the buffer's edge (CPU and GPU) |
|
||||
| 2026-11-17 | minor | Drop Shadow: Softness takes After Effects' recorded valid range, 0..30000 (default and 0..250 slider unchanged). Where the padding budget cuts the margin, the shadow keeps its full blur (σ = Softness / 2) up to the buffer's edge, where it is cut; that case renders on the CPU |
|
||||
| 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) |
|
||||
|
||||
Reference in new issue
Block a user