summaryrefslogtreecommitdiffhomepage
path: root/shaders/glsl330/scanlines.fs
diff options
context:
space:
mode:
authorRay <[email protected]>2017-05-15 22:48:04 +0200
committerRay <[email protected]>2017-05-15 22:48:04 +0200
commitaba25e9ba379cdf2e68b65f55dd08ab4e0d713d8 (patch)
tree7a280f0f2a422a938aba1e93fcff83340e6504a0 /shaders/glsl330/scanlines.fs
parent5f09c71f983be066207522818f7be504a1b4592e (diff)
downloadraylib-aba25e9ba379cdf2e68b65f55dd08ab4e0d713d8.tar.gz
raylib-aba25e9ba379cdf2e68b65f55dd08ab4e0d713d8.zip
Move shaders to examples
Diffstat (limited to 'shaders/glsl330/scanlines.fs')
-rw-r--r--shaders/glsl330/scanlines.fs49
1 files changed, 0 insertions, 49 deletions
diff --git a/shaders/glsl330/scanlines.fs b/shaders/glsl330/scanlines.fs
deleted file mode 100644
index 22dc9cd5..00000000
--- a/shaders/glsl330/scanlines.fs
+++ /dev/null
@@ -1,49 +0,0 @@
-#version 330
-
-// Input vertex attributes (from vertex shader)
-in vec2 fragTexCoord;
-in vec4 fragColor;
-
-// Input uniform values
-uniform sampler2D texture0;
-uniform vec4 colDiffuse;
-
-// Output fragment color
-out vec4 finalColor;
-
-// NOTE: Add here your custom variables
-
-// NOTE: Render size values must be passed from code
-const float renderWidth = 800;
-const float renderHeight = 450;
-float offset = 0.0;
-
-uniform float time;
-
-void main()
-{
- float frequency = renderHeight/3.0;
-/*
- // Scanlines method 1
- float tval = 0; //time
- vec2 uv = 0.5 + (fragTexCoord - 0.5)*(0.9 + 0.01*sin(0.5*tval));
-
- vec4 color = texture(texture0, fragTexCoord);
-
- color = clamp(color*0.5 + 0.5*color*color*1.2, 0.0, 1.0);
- color *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0 - uv.x)*(1.0 - uv.y);
- color *= vec4(0.8, 1.0, 0.7, 1);
- color *= 0.9 + 0.1*sin(10.0*tval + uv.y*1000.0);
- color *= 0.97 + 0.03*sin(110.0*tval);
-
- fragColor = color;
-*/
- // Scanlines method 2
- float globalPos = (fragTexCoord.y + offset) * frequency;
- float wavePos = cos((fract(globalPos) - 0.5)*3.14);
-
- // Texel color fetching from texture sampler
- vec4 texelColor = texture(texture0, fragTexCoord);
-
- finalColor = mix(vec4(0.0, 0.3, 0.0, 0.0), texelColor, wavePos);
-} \ No newline at end of file