diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 07:41:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 411d0b6059192b75853e220e1242b694ae461a3e (patch) | |
| tree | 50f8bb207f3cdda497bdd84658a2d3ea74b4bc2b /shaders/decor.frag.glsl | |
| parent | da920ca49e3f5d1649e811bbdc3ddba482c6aae4 (diff) | |
| parent | 5526c68beec454cfe607a579723b97b4848e7d3a (diff) | |
| download | pardes-411d0b6059192b75853e220e1242b694ae461a3e.tar.gz pardes-411d0b6059192b75853e220e1242b694ae461a3e.zip | |
Merge: 9P rounds 9-17 + render DPI, dark tints, G4-G10
Diffstat (limited to 'shaders/decor.frag.glsl')
| -rw-r--r-- | shaders/decor.frag.glsl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shaders/decor.frag.glsl b/shaders/decor.frag.glsl index 3e2c286f..bb1ef0d6 100644 --- a/shaders/decor.frag.glsl +++ b/shaders/decor.frag.glsl @@ -8,6 +8,8 @@ // colour rides in the cell's ground (a_bg), its coverage in a_fg.r, so the // result is the overlay pipeline's exactly. // +// Checker (flag 0x08000000): two colours in squares, or in stripes, see main. +// // 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 @@ -51,6 +53,17 @@ 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; float opacity = clamp(u_ui.background_opacity, 0.0, 1.0); + // Checker (flag 0x08000000): squares of v_uv.x pixels from the quad's + // own corner, so it moves with its rail, in the ground's colour and the + // ink's (lapis's scroll track). + vec2 in_quad = v_cell_uv / max(vec2(dFdx(v_cell_uv.x), dFdy(v_cell_uv.y)), vec2(1e-6)); + if ((v_effect.x & 0x08000000u) != 0u) { + ivec2 q = ivec2(floor(in_quad / max(v_uv.x, 1.0))); + // v_uv.y set: stripes across the quad (lapis's title bar), not squares. + int k = v_uv.y > 0.5 ? q.y : q.x + q.y; + o_col = vec4(((k & 1) == 0 ? v_bg : v_fg) * opacity, 1.0); + return; + } if ((v_effect.x & 0x10000000u) == 0u) { o_col = vec4(v_bg * opacity, v_fg.r); return; |
