File: scanline.fs

package info (click to toggle)
libretro-bsnes-mercury 094%2Bgit20160126-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,632 kB
  • sloc: cpp: 109,056; ansic: 3,097; makefile: 638; xml: 11; sh: 1
file content (20 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 150

uniform sampler2D source[];

in Vertex {
  vec2 texCoord;
};

out vec4 fragColor;

void main() {
  vec4 rgba = texture(source[0], texCoord);
  vec4 intensity;
  if(fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5) {
    intensity = vec4(0);
  } else {
    intensity = smoothstep(0.2, 0.8, rgba) + normalize(rgba);
  }
  fragColor = intensity * -0.25 + rgba * 1.1;
}