Effects: Fractal and Turbulent Noise stay inside the layer's alpha (#939)
Masks are applied before effects, but the noise was composited with the Opacity alpha alone, so a masked solid filled the whole layer. The result is now multiplied by the original alpha on the CPU and on both GPU paths (kernels.wgsl for the default settings, fx_noise.wgsl for the rest). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
67434e9038
commit
09b3042e20
@@ -665,7 +665,7 @@ fn fxn_fractal(@builtin(global_invocation_id) gid: vec3<u32>) {
|
||||
r = blend_pixel(P.u[2].x, orig, s, 0.5);
|
||||
}
|
||||
let bo = P.f[1].w;
|
||||
textureStore(out, p, orig * bo + r * (1.0 - bo));
|
||||
textureStore(out, p, orig * bo + r * orig.a * (1.0 - bo));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Noise Alpha / Noise HLS (noise.rs)
|
||||
|
||||
@@ -858,13 +858,13 @@ fn pointwise(@builtin(global_invocation_id) gid: vec3<u32>) {
|
||||
val = 1.0 - val;
|
||||
}
|
||||
let op = P.f[2].z;
|
||||
var fx = vec4<f32>(vec3<f32>(val) * op, op);
|
||||
if (P.u[1].z == 1u) {
|
||||
// Normal: the noise over the layer at Opacity, then Blend With Original.
|
||||
let over = vec4<f32>(vec3<f32>(val) * op, op) + px * (1.0 - op);
|
||||
px = px * P.f[2].y + over * (1.0 - P.f[2].y);
|
||||
} else {
|
||||
px = put(px, vec3<f32>(val), op, P.f[2].y);
|
||||
// Normal: the noise over the layer at Opacity.
|
||||
fx = fx + px * (1.0 - op);
|
||||
}
|
||||
// Inside the layer's alpha (its masks), then Blend With Original.
|
||||
px = px * P.f[2].y + fx * px.w * (1.0 - P.f[2].y);
|
||||
}
|
||||
default: {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user