Fill: Opacity is the filled layer's opacity, as After Effects

Without a Fill Mask, After Effects turns the layer into the fill colour and
applies Opacity to its alpha; nothing of the original shows through. AE 2026
renders Fill (0, 0.5, 1) at Opacity 50 % on a Gradient Ramp over a red solid
as premultiplied (0, 0.251, 0.502) at alpha 0.502 at every pixel; EffectCraft
mixed the fill with the ramp (mean difference 95.5/255), now within 1/255,
CPU and GPU. Invert fills the transparent part the same way. With a Fill
Mask the mix with the original is unchanged (not measured). Lottie's fill
effect (colour, alpha x opacity) now plays the same in EffectCraft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-19 16:16:12 +02:00
co-authored by Claude Opus 5.5
parent d7854b84a3
commit 84ffc8453e
3 changed files with 34 additions and 16 deletions
+3 -7
View File
@@ -766,17 +766,13 @@ fn pointwise(@builtin(global_invocation_id) gid: vec3<u32>) {
let c = P.f[0];
let invert = P.u[0].y != 0u;
let opacity = P.f[1].x;
// The fill colour at the layer's (or inverted) alpha times Opacity (color_fx::fill).
var fa = px.w;
if (invert) {
fa = 1.0 - px.w;
}
let f = c.xyz * fa;
let rgb = px.xyz + (f - px.xyz) * opacity;
var alpha = px.w;
if (invert) {
alpha = px.w + (fa - px.w) * opacity;
}
px = vec4<f32>(rgb, alpha);
fa = fa * opacity;
px = vec4<f32>(c.xyz * fa, fa);
}
case 8u: {
// effects::color2::map_ca: transparent pixels only change through the alpha curve.