diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 06:58:19 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | c1dbb16d069a54f52533f346655b0fc49026c9a4 (patch) | |
| tree | 0a82753404805951cf7fda3973b86d7741f73833 /shaders | |
| parent | ff252345bc3e1edc1aee93ca826f294bf9a7874f (diff) | |
| download | pardes-c1dbb16d069a54f52533f346655b0fc49026c9a4.tar.gz pardes-c1dbb16d069a54f52533f346655b0fc49026c9a4.zip | |
G7: a moving pane casts a shadow, a retargeted move keeps its speed, a dissolve crossfades
- Track.launch: a move retargeted mid-way (Presentation.sync) starts at
the old move's speed along the new one's longest side (carriedLaunch,
Motion.easeFrom/speedFrom), so a second change during a slide bends the
motion instead of stopping it dead. The macOS track ABI grows the float
(pardes.h, 48 bytes; its reserved byte is named motion, as in Zig).
- A pane that slides, zooms or rises casts Lift's soft shadow at
sin(pi x progress) of its strength, on the other panes' bodies and
rails alone, under the same contrast ceiling, carried by its track.
- The GUI's PanelDissolve is a crossfade: the new cell drawn first, the
old one over it at 1 - progress, premultiplied, on the blending cell
pipeline for such groups (new cells now emitted before old ones, as the
old layers already came after the new). sRGB blend, not linear light
(documented). The tty keeps its per-cell swap.
Presentation.zig's and animation.zig's tests were not in any test root;
pardes.zig's test block now takes them in.
Tests: a retargeted move carries its speed and still lands exactly; a
moving pane's shadow is clipped off every tag, grip and its own body,
none at the start or the landing, most mid-way. GUI golden 18 changes by
the shadow (frame 6 of a slide). Gates as G6. Feel review:
.scratch/render/transitions/.
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/prebuilt/ui.frag.glsl | 17 | ||||
| -rw-r--r-- | shaders/prebuilt/ui.frag.spv | bin | 8448 -> 8176 bytes | |||
| -rw-r--r-- | shaders/ui.frag.glsl | 17 |
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 Binary files differindex d83d9c55..15318214 100644 --- a/shaders/prebuilt/ui.frag.spv +++ b/shaders/prebuilt/ui.frag.spv 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; } |
