diff options
Diffstat (limited to 'shaders/post/crt.glsl')
| -rw-r--r-- | shaders/post/crt.glsl | 6 |
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); |
