From aba25e9ba379cdf2e68b65f55dd08ab4e0d713d8 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 15 May 2017 22:48:04 +0200 Subject: Move shaders to examples --- shaders/glsl330/scanlines.fs | 49 -------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 shaders/glsl330/scanlines.fs (limited to 'shaders/glsl330/scanlines.fs') 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 -- cgit v1.2.3