summaryrefslogtreecommitdiff
path: root/shaders/decor.frag.glsl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 14:59:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit360b72ade0acfa655a3740b638a0cc8e23238a05 (patch)
tree4bc9464da2cdcfd6fe636979f0b457221ec92c3d /shaders/decor.frag.glsl
parentd88e381793c6505bf3f2af43705bd2fa32f55ef6 (diff)
downloadpardes-360b72ade0acfa655a3740b638a0cc8e23238a05.tar.gz
pardes-360b72ade0acfa655a3740b638a0cc8e23238a05.zip
The GUI draws in tiers from the regions; pane chrome moves with its pane
Stage 8 of docs/render-pipeline.md. The frame is drawn in groups: tier 0, one per track in paint order (tiers 2 and 3), tier 4 (notices, then guides and the debug box), tier 5 (bar cursors), each cells, images, decor. Decor (rules, rails, thumbs, grip marks, spines, the workspace and column rules, the bottom band, notice rules, bar cursors) is whole-pixel rects through the new decor.frag over ui.vert, so it carries its track's transition and clip. A closing pane's chrome comes from Surface.previous_regions. Deleted: taglineBaseRgb, topbarPaneBorderHeight, bottomTaglinePresent, frameChromeBg, cellBackgroundIs and the rail inference, paneGripCell's scan, transient_on, PaintPlan. One cover map (coverFrame) is marked from the layers and regions once a frame. New regions column, guide and debug; Surface.chrome is the palette, carried in wire v8 (not shipped yet), so an attached GUI draws the same chrome (test). A per-instance clip replaces the vertical transition's scissor. Goldens: 01-12 byte-identical. 13-17 differ only past the grid: the image pass left its scissor at the grid's size, cutting rule ends, rail feet and the bottom band in the leftover pixels whenever a picture was on screen. 16-debug now shows the debug box, which a context-row layer had hidden. 18-mid-transition is new: virtual clock (PARDES_TEST_CLOCK in the GUI), PanelSlide Newcol with the picture, frame 6 of 12. Also: the GUI sleeps when idle instead of polling every 16 ms, and a minimized or occluded window sleeps through animation. Tracy 'gui frame build' at 200x60: 992/1015 us median before, 989/987 us after. Shared files touched: pardes.zig (one export), detached/client.zig, detached/server.zig, detached/wire.zig (all additive), gui.zig. Not touched: Messages.zig, mouse.zig, tagline.zig, colors.zig, tty.zig, host_io.zig, dump.zig, exec.zig, panes.zig.
Diffstat (limited to 'shaders/decor.frag.glsl')
-rw-r--r--shaders/decor.frag.glsl24
1 files changed, 24 insertions, 0 deletions
diff --git a/shaders/decor.frag.glsl b/shaders/decor.frag.glsl
new file mode 100644
index 00000000..4c2bd6d8
--- /dev/null
+++ b/shaders/decor.frag.glsl
@@ -0,0 +1,24 @@
+#version 450
+
+// Decor: a flat, hard-edged fill (a rule, a rail, a grip mark, a bar cursor)
+// that ui.vert.glsl places like a cell, its track's transition included. Its
+// colour rides in the cell's ground (a_bg) and its coverage in a_fg.r. The
+// pipeline blends it as the overlay pipeline does (backgroundLayerBlend), so
+// a fading rule shows through, and the result is that pipeline's exactly.
+// Ink (a cursor) is drawn with the opacity uniform at 1.
+
+layout(std140, set = 3, binding = 0) uniform UiUniforms {
+ float background_opacity;
+} u_ui;
+
+layout(location = 1) in vec3 v_fg;
+layout(location = 2) in vec3 v_bg;
+layout(location = 5) flat in vec4 v_clip;
+
+layout(location = 0) out vec4 o_col;
+
+void main() {
+ if (v_clip.z >= v_clip.x && (gl_FragCoord.x < v_clip.x || gl_FragCoord.x >= v_clip.z ||
+ gl_FragCoord.y < v_clip.y || gl_FragCoord.y >= v_clip.w)) discard;
+ o_col = vec4(v_bg * clamp(u_ui.background_opacity, 0.0, 1.0), v_fg.r);
+}