Created
August 3, 2016 07:36
-
-
Save code-disaster/869c1c47d8b708dc2458538907445952 to your computer and use it in GitHub Desktop.
simple scanline shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* post-fx pass by blending a solid white fullscreen quad, no texture required */ | |
/*uniform*/ float fmin = 0.7; | |
void main(void) | |
{ | |
float fmod = mod(gl_FragCoord.y, 2.0); | |
float fstep = fmin + (1.0 - fmin) * fmod; | |
gl_FragColor = vec4(1.0, 1.0, 1.0, fstep); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* shadertoy test - blends with a texture */ | |
float fmin = 0.7; | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
float fmod = mod(fragCoord.y, 2.0); | |
float fstep = fmin + (1.0 - fmin) * fmod; | |
vec2 uv = fragCoord.xy / iResolution.xy; | |
fragColor = vec4(texture2D(iChannel0, uv).rgb * fstep, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment