diff options
Diffstat (limited to 'shaders/ui.frag.glsl')
| -rw-r--r-- | shaders/ui.frag.glsl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/shaders/ui.frag.glsl b/shaders/ui.frag.glsl index 62dbbfa2..cb38fff1 100644 --- a/shaders/ui.frag.glsl +++ b/shaders/ui.frag.glsl @@ -82,13 +82,18 @@ void main() { } vec4 cell = vec4(mix(under.rgb, v_fg, a), mix(under.a, 1.0, a)); - // 3 = data dissolve. Changed cells retain the frozen old cell until their - // stable threshold, then atomically become the new cell. Exact endpoints - // mirror panel_animation.dissolveRevealed, including the zero hash. + // 3 = dissolve, a crossfade (G7): a changed cell's new form is drawn + // first, whole, and its frozen old one over it at 1 - progress, + // premultiplied (the frame's cells blend over, pipeline_over), so the + // old fades out as the new comes in; at the ends, exactly one of them. + // The tty keeps its per-cell swap (panel_animation.dissolveRevealed). if (effect == 3u) { - bool reveal = progress >= 1.0 || (progress > 0.0 && noise < progress); - if (oldLayer ? reveal : !reveal) discard; - o_col = cell; + if (!oldLayer) { + o_col = cell; + return; + } + if (progress >= 1.0) discard; + o_col = cell * (1.0 - progress); return; } |
