summaryrefslogtreecommitdiff
path: root/shaders/post/crt.glsl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 07:41:35 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit411d0b6059192b75853e220e1242b694ae461a3e (patch)
tree50f8bb207f3cdda497bdd84658a2d3ea74b4bc2b /shaders/post/crt.glsl
parentda920ca49e3f5d1649e811bbdc3ddba482c6aae4 (diff)
parent5526c68beec454cfe607a579723b97b4848e7d3a (diff)
downloadpardes-411d0b6059192b75853e220e1242b694ae461a3e.tar.gz
pardes-411d0b6059192b75853e220e1242b694ae461a3e.zip
Merge: 9P rounds 9-17 + render DPI, dark tints, G4-G10
Diffstat (limited to 'shaders/post/crt.glsl')
-rw-r--r--shaders/post/crt.glsl6
1 files changed, 4 insertions, 2 deletions
diff --git a/shaders/post/crt.glsl b/shaders/post/crt.glsl
index 768157ef..970d61ee 100644
--- a/shaders/post/crt.glsl
+++ b/shaders/post/crt.glsl
@@ -69,9 +69,11 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
// A beam is brightest on its line and falls off between lines; the
// mask is three phosphor stripes a triad. Both average to one, so the
// theme keeps its brightness.
- float line = 0.5 + 0.5 * cos(fragCoord.y * TAU / SCAN_PERIOD_PX);
+ // Periods in logical pixels: the same look at any density.
+ float density = max(1.0, pardesScale);
+ float line = 0.5 + 0.5 * cos(fragCoord.y * TAU / (SCAN_PERIOD_PX * density));
col *= 1.0 - scanStrength() * (line * line - 0.375) / 0.625;
- col *= 1.0 + maskStrength() * cos(fragCoord.x * TAU / MASK_PERIOD_PX + vec3(0.0, TAU / 3.0, 2.0 * TAU / 3.0));
+ col *= 1.0 + maskStrength() * cos(fragCoord.x * TAU / (MASK_PERIOD_PX * density) + vec3(0.0, TAU / 3.0, 2.0 * TAU / 3.0));
float vignette = 1.0 - vignetteStrength() * pow(clamp(r2 * 0.5, 0.0, 1.0), 1.6);
float hum = 1.0 + humStrength() * sin((uv.y * 1.35 - iTime * HUM_HZ) * TAU);