scanline.fs 365 B

123456789101112131415161718
  1. #version 150
  2. uniform sampler2D source[];
  3. in Vertex {
  4. vec2 texCoord;
  5. };
  6. out vec4 fragColor;
  7. void main(void) {
  8. vec4 rgba = texture(source[0], texCoord);
  9. vec4 intensity;
  10. if(fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5) intensity = vec4(0);
  11. else intensity = smoothstep(0.2, 0.8, rgba) + normalize(rgba);
  12. fragColor = intensity * -0.35 + rgba * 1.1;
  13. }