fix(effects): clear Cut Away 100 opaque edges

The gradient antialias could leave a half-covered pixel where an opaque source reaches h = 1. Add an endpoint guard on CPU and GPU and cover an opaque edge in the regression test.
This commit is contained in:
Camille Moine
2026-10-21 14:46:21 +02:00
parent fda7eef73f
commit 374c3bf6b9
3 changed files with 22 additions and 0 deletions
@@ -582,6 +582,12 @@ fn ftr_blob(@builtin(global_invocation_id) gid: vec3<u32>) {
return;
}
let cut = P.f[0].x;
if (cut >= 1.0) {
// Endpoint guard: an opaque source can reach h = 1.0, where the gradient antialias
// would otherwise leave a half-covered pixel at Cut Away 100.
textureStore(out, p, vec4<f32>(0.0));
return;
}
let hv = textureLoad(aux, p, 0).x;
let g = ftr_grad(p);
let grad = length(g);
+1
View File
@@ -126,6 +126,7 @@ fn distort() {
"ec.distort.ccblobbylize",
&[("property", e(4)), ("softness", n(3.0)), ("cutAway", n(30.0)), ("lightType", e(1)), ("lightPosition", pt(20.0, 10.0))],
);
effect_case("ec.distort.ccblobbylize", &[("cutAway", n(100.0))]);
effect_case("ec.distort.ccblobbylize", &[("property", e(5)), ("metal", n(30.0)), ("roughness", n(0.2))]);
}