diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 00:13:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:40:08 -0300 |
| commit | b1d2c6ae01bf08370e18913ac6a7e8f0074c9113 (patch) | |
| tree | 37612ae2f85e931ba62c6d91674a758896133802 /src/gui/Post.zig | |
| parent | 3ece644731e94584beb17bc75e3628ecde8cd7d2 (diff) | |
| download | pardes-b1d2c6ae01bf08370e18913ac6a7e8f0074c9113.tar.gz pardes-b1d2c6ae01bf08370e18913ac6a7e8f0074c9113.zip | |
gui: gripDecor draws a grip's mode bars from its first row without a loop over the rows it skipped, Post's vignette ceiling is shadowCeiling's (the same sum), ShaderBuild drops expand and a Wake struct whose ctx was never set, and ShaderBuild's and Post's headers say an attached window runs the bundled passes alone (no SPIR-V travels the wire)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/gui/Post.zig')
| -rw-r--r-- | src/gui/Post.zig | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/Post.zig b/src/gui/Post.zig index 64a431b9..19b10c52 100644 --- a/src/gui/Post.zig +++ b/src/gui/Post.zig @@ -2,8 +2,8 @@ //! finished frame, each reading the one before it (the frame first) and the //! last one writing the window. A pass is the bundled Crt (shaders/post/, //! compiled with the build) or a user's file (Shader <path>), whose SPIR-V -//! comes from ShaderBuild.zig: compiled by the process that holds the core, -//! this one or the detached session this GUI is attached to. A file whose +//! comes from ShaderBuild.zig, compiled by this process (a window attached +//! to a session elsewhere runs the bundled passes alone). A file whose //! compile fails keeps its last good pipeline. //! //! The uniforms are ghostty's (Uniforms), so a shader written for ghostty runs @@ -289,7 +289,6 @@ fn unit(rgb: [3]u8) [3]f32 { pub fn capsOf(frame: Frame) std.EnumArray(Scene, f32) { const pairs = [_][2][3]f32{ .{ unit(frame.foreground), unit(frame.background) }, .{ unit(frame.selection_foreground), unit(frame.selection_background) } }; var bloom: f32 = 1; - var shade: f32 = 1; for (pairs) |pair| { const a = luminance(pair[0]); const b = luminance(pair[1]); @@ -298,10 +297,9 @@ pub fn capsOf(frame: Frame) std.EnumArray(Scene, f32) { const target = @min(contrastOf(a, b), 4.5); // (light + e + .05) / (dark + e + .05) >= target bloom = @min(bloom, @max(0, (light + 0.05 - target * (dark + 0.05)) / @max(target - 1, 1e-3))); - // (k light + .05) / (k dark + .05) >= target, darkened by 1 - k - const room = light - target * dark; - shade = @min(shade, if (room <= 0) 0 else std.math.clamp(1 - 0.05 * (target - 1) / room, 0, 1)); } + // A vignette darkens both of a pair as a lift's shadow does. + const shade = @min(gui.shadowCeiling(frame.foreground, frame.background), gui.shadowCeiling(frame.selection_foreground, frame.selection_background)); // Grain: the largest step off the page, up and down, that keeps the text // on it at its contrast or 4.5 (searched in 1/1020 steps up to 8/255). const ink = luminance(unit(frame.foreground)); |
