EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
Review: Glow's WGSL literals tied to GLOW_GAIN / GLOW_KNEE; parity summary consistent
vangel7683c76f266fc6
diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rsindex 71adf2bae..561a41cbe 100644--- a/crates/effects/src/lib.rs+++ b/crates/effects/src/lib.rs@@ -85,7 +85,10 @@ use effectcraft_keyframe::Value;use effectcraft_project::build::Ids;use effectcraft_project::{GroupKind, ParamUi, PropGroup, Property};pub use effectcraft_raster::{AuxChannels, Image};-pub use misc::{INVERT_ALPHA, INVERT_CHANNELS, glow_ab_t, glow_operation, glow_sigma, radial_wipe_sigma, radial_wipe_wedge, venetian_cover, venetian_origin};+pub use misc::{+ GLOW_GAIN, GLOW_KNEE, INVERT_ALPHA, INVERT_CHANNELS, glow_ab_t, glow_operation, glow_sigma, radial_wipe_sigma, radial_wipe_wedge, venetian_cover,+ venetian_origin,+};pub use sim::particle_state;pub use sim3::{PgBlit, PgPlan, playground_plan, playground_state};pub use stylize2::strobe_on;diff --git a/crates/effects/src/misc.rs b/crates/effects/src/misc.rsindex fa92c998e..e39f311de 100644--- a/crates/effects/src/misc.rs+++ b/crates/effects/src/misc.rs@@ -137,7 +137,8 @@ pub fn glow_bright_channel(v: f32, thr: f32) -> f32 {(GLOW_GAIN * (v - thr + GLOW_KNEE)).max(0.0)}-/// [`glow_bright_channel`]'s gain and threshold offset.+/// [`glow_bright_channel`]'s gain and threshold offset. `kernels.wgsl` repeats both as literals;+/// the GPU test `glow_constants_match_the_cpu` checks that they are these.pub const GLOW_GAIN: f32 = 8.0;pub const GLOW_KNEE: f32 = 0.0611;diff --git a/crates/gpu/src/shaders/kernels.wgsl b/crates/gpu/src/shaders/kernels.wgslindex ca28e4fc7..a855ca38d 100644--- a/crates/gpu/src/shaders/kernels.wgsl+++ b/crates/gpu/src/shaders/kernels.wgsl@@ -394,7 +394,9 @@ fn glow_bright(@builtin(global_invocation_id) gid: vec3<u32>) {} else if (P.u[0].y != 0u) {textureStore(out, p, vec4<f32>(px.xyz * k, ga));} else {- // Original colours, per channel (effects::misc::glow_bright_channel).+ // Original colours, per channel (effects::misc::glow_bright_channel): gain 8.0 is+ // effects::GLOW_GAIN, 0.0611 is effects::GLOW_KNEE (checked by the test+ // glow_constants_match_the_cpu).let c = max(8.0 * (px.xyz / a - vec3<f32>(thr - 0.0611)), vec3<f32>(0.0));textureStore(out, p, vec4<f32>(c * a, ga));}diff --git a/crates/gpu/src/tests.rs b/crates/gpu/src/tests.rsindex 24f8c9614..e7a68e7bc 100644--- a/crates/gpu/src/tests.rs+++ b/crates/gpu/src/tests.rs@@ -851,6 +851,16 @@ fn effects_whose_kernels_failed_render_on_the_cpu() {}}+/// WGSL cannot read the CPU's constants, so Glow's bright pass repeats them as literals; this+/// ties them to `effects::GLOW_GAIN` / `GLOW_KNEE` (runs without a GPU).+#[test]+fn glow_constants_match_the_cpu() {+ use effectcraft_effects::{GLOW_GAIN, GLOW_KNEE};+ let kernels = include_str!("shaders/kernels.wgsl");+ let want = format!("max({GLOW_GAIN:?} * (px.xyz / a - vec3<f32>(thr - {GLOW_KNEE:?})), vec3<f32>(0.0))");+ assert!(kernels.contains(&want), "Glow's bright pass in kernels.wgsl is not `{want}`");+}+/// A layer whose bounds change every frame reads back at a new size each time: the staging/// buffers kept for reuse stay within budget instead of growing for the whole render (#2081).#[test]diff --git a/docs/effects-parity.md b/docs/effects-parity.mdindex 92a9775c1..2f97c8e56 100644--- a/docs/effects-parity.md+++ b/docs/effects-parity.md@@ -15,7 +15,7 @@ After Effects', and does the preset library exist. The per-effect catalogue is t| Parameter names, order, popups, units, defaults | aligned in M9.12 | Agent-checked against After Effects' documentation, not against a live dump || On the GPU | **280** (92%) | Measured: registry flags; GPU vs CPU agreement tested per effect || 32-bit float, no clamping | 306 | Measured: registry flags |-| **Rendered output matches After Effects** | **unmeasured** | No effect is compared with an After Effects render yet. `effectcraft_effects::fidelity::compare_frames` exists for the corpus ([fidelity/README.md](fidelity/README.md)); simulation effects are pinned by golden hashes of our own output (M13.27) |+| **Rendered output matches After Effects** | **partly measured** | Radial Blur, Glow, Venetian Blinds, Radial Wipe, Fractal / Turbulent Noise and Transform are checked against After Effects 2026 renders of our own test projects (rows below); every other effect is unmeasured. `effectcraft_effects::fidelity::compare_frames` exists for the corpus ([fidelity/README.md](fidelity/README.md)); simulation effects are pinned by golden hashes of our own output (M13.27) || Animation presets | **54** original presets (8 text-animator, 23 Transitions, 23 Backgrounds) against After Effects' **621** `.ffx` presets | Measured: `crates/engine/presets/text_animators.json`, `crates/engine/presets/transitions.json`, `crates/engine/presets/backgrounds.json`; the After Effects `Presets` folder || 26.x additions | Curl Noise (26.3) present (#463 open); effect colour labels (26.5) present in Effect Controls only, not in the Timeline; the rebuilt Effect Controls (26.5) missing | Release notes |@@ -66,7 +66,7 @@ the GPU is performance, not parity.|---|---|---|| 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) |-| 2026-10-19 | minor | Radial Blur repeats the edge instead of sampling transparency outside the layer, measured against After Effects 2026 renders (CPU and GPU) |+| 2026-10-19 | minor | Radial Blur repeats the edge instead of sampling transparency outside the layer, measured against After Effects 2026 renders (CPU; Radial Blur has no GPU path) || 2026-10-19 | minor | Venetian Blinds: stripes measured from the layer centre, both band edges Gaussian (σ = Feather / 2), measured against After Effects 2026 (CPU and GPU) || 2026-10-19 | minor | Radial Wipe: Feather is in pixels on both edges of the wiped wedge (was degrees on the moving edge only), measured against After Effects 2026 (CPU and GPU) || 2026-10-19 | minor | Fractal / Turbulent Noise: lattice cell = Scale × 2/3 px (Block noise every 66.7 px at Scale 100, as After Effects 2026), CPU and GPU |