summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/prebuilt/ui.frag.glsl17
-rw-r--r--shaders/prebuilt/ui.frag.spvbin8448 -> 8176 bytes
-rw-r--r--shaders/ui.frag.glsl17
3 files changed, 22 insertions, 12 deletions
diff --git a/shaders/prebuilt/ui.frag.glsl b/shaders/prebuilt/ui.frag.glsl
index 62dbbfa2..cb38fff1 100644
--- a/shaders/prebuilt/ui.frag.glsl
+++ b/shaders/prebuilt/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;
}
diff --git a/shaders/prebuilt/ui.frag.spv b/shaders/prebuilt/ui.frag.spv
index d83d9c55..15318214 100644
--- a/shaders/prebuilt/ui.frag.spv
+++ b/shaders/prebuilt/ui.frag.spv
Binary files differ
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;
}