aeon-199x/shaders/module/scanline.frag

19 lines
361 B
GLSL
Raw Normal View History

2024-05-03 22:08:09 -04:00
#include "/var/scanline.glsl"
#define scanline 0 // [0 1 2]
2024-05-03 22:24:04 -04:00
vec3 scanlines(vec3 color) {
2024-05-03 22:08:09 -04:00
#if scanline == SCANLINE_SOFT
2024-05-03 22:24:04 -04:00
if(mod(int(gl_FragCoord.y / pixelSize * 2), 2) == 0)
2024-05-03 22:08:09 -04:00
color.rgb *= 0.95;
else
color.rgb /= 0.95;
#elif scanline == SCANLINE_HARD
2024-05-03 22:24:04 -04:00
if(mod(int(gl_FragCoord.y / pixelSize), 2) == 0)
2024-05-03 22:08:09 -04:00
color.rgb *= 0.5;
#endif
2024-05-03 22:24:04 -04:00
return color;
2024-05-03 22:08:09 -04:00
}