Onion tint: screen-blend instead of multiply (so outlines tint too)
Multiplicative tint left blacks black, so outlines (the main thing to ghost in line art) never picked up the warm/cool color. Switched the canvas-blit tint to a screen blend (out = base + tint - base*tint): black → tint color, white unchanged, and a clean no-op at tint=(0,0,0) for all normal blits. Reverted the default .w slots to 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
53cae1bfe5
commit
4dc937f9c0
@@ -67,8 +67,11 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let mask = textureSample(mask_tex, mask_sampler, canvas_uv).r;
|
||||
let masked_a = c.a * mask;
|
||||
let inv_a = select(0.0, 1.0 / c.a, c.a > 1e-6);
|
||||
// RGB tint packed into the matrix uniform's unused .w slots (1,1,1 = no tint).
|
||||
// Used by onion-skin ghosts (warm = past, cool = future).
|
||||
// RGB tint packed into the matrix uniform's unused .w slots ((0,0,0) = no tint).
|
||||
// Screen-blended so it recolors blacks too (outlines → warm/cool ghosts) and
|
||||
// leaves white alone: out = base + tint - base*tint. Used by onion-skin ghosts.
|
||||
let tint = vec3<f32>(transform.col0.w, transform.col1.w, transform.col2.w);
|
||||
return vec4<f32>(c.r * inv_a * tint.r, c.g * inv_a * tint.g, c.b * inv_a * tint.b, masked_a);
|
||||
let base = vec3<f32>(c.r * inv_a, c.g * inv_a, c.b * inv_a);
|
||||
let tinted = base + tint - base * tint;
|
||||
return vec4<f32>(tinted, masked_a);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user