mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
Merge pull request #951 from HEOJUNFO/fix-939-noise-mask
Effects: Fractal and Turbulent Noise stay inside the layer's alpha (#939)
This commit is contained in:
commit
7864ea41ae
3 files changed
+31
-8
No files matched your search
@@ -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)
|
||||
|
||||
@@ -865,13 +865,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