diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 18:14:36 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | f41d0209f65237568c9f7d527d5989ac8921b74c (patch) | |
| tree | c313dc20fa0593ecff725de32d6ad191b01d82ac /shaders | |
| parent | b4781b334a06d16aedb0b6a3d604cb249eb619de (diff) | |
| download | pardes-f41d0209f65237568c9f7d527d5989ac8921b74c.tar.gz pardes-f41d0209f65237568c9f7d527d5989ac8921b74c.zip | |
Lift takes a style: shadow, surface, rim, glow or auto
The user wants Lift to read on dark themes, where a shadow has nothing to
darken. `Lift shadow|surface|rim|glow|auto` (`on` is auto, bare flips
auto and off): surface lightens the lifted part's ground about 5.5%
(Material-dark), rim is a thin soft light off its top and left edges,
glow a faint halo in the theme's accent (Chrome.accent, the focused box
colour), auto a shadow on a light page and surface with half a rim on a
dark one (by the page's luminance). Rim and glow are the soft kernel in a
light colour (no pre-warp: coloured light is laid on as is, within §8.2's
budget); each style is capped per theme so text keeps min(its contrast,
4.5) (tests: darkening and lightening over the native themes). The style
travels in the palette (Chrome.lift_style, one byte on the wire). Config
reports and ctl reads `Lift <style>`.
Shared files touched: config.zig, builtins.zig, ninep/ctl.zig,
detached/wire.zig (palette byte), gui.zig. Not touched: pardes.zig,
Messages.zig, mouse.zig.
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/decor.frag.glsl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shaders/decor.frag.glsl b/shaders/decor.frag.glsl index 77f9c95e..3e2c286f 100644 --- a/shaders/decor.frag.glsl +++ b/shaders/decor.frag.glsl @@ -8,7 +8,7 @@ // colour rides in the cell's ground (a_bg), its coverage in a_fg.r, so the // result is the overlay pipeline's exactly. // -// Soft shadow (flag 0x10000000): a rectangle's shadow blurred by a Gaussian, +// Soft (flag 0x10000000): a rectangle's shadow, rim or glow blurred by a Gaussian, // in closed form (the product of two erf edges), on one quad grown by 3 // sigma: no blur pass. Everything is in the quad's own 0..1 space, so a // track's transform carries it: sigma per axis in the uv, the caster's @@ -62,7 +62,9 @@ void main() { vec2 caster1 = 1.0 - m - v_fg.gb; if (all(greaterThanEqual(p, caster0)) && all(lessThan(p, caster1))) discard; float a = v_fg.r * edge(p.x, m.x, 1.0 - m.x, s.x) * edge(p.y, m.y, 1.0 - m.y, s.y); - a = 1.0 - pow(max(1.0 - a, 0.0), 1.0 / 2.2); + // Black darkens in linear light; a light colour (a rim, a glow) is laid + // on as it is, within §8.2's 25%. + if (all(equal(v_bg, vec3(0.0)))) a = 1.0 - pow(max(1.0 - a, 0.0), 1.0 / 2.2); a = clamp(a + (ign(gl_FragCoord.xy) - 0.5) / 255.0, 0.0, 1.0); o_col = vec4(v_bg * opacity, a); } |
