Created
May 12, 2015 07:15
-
-
Save quadpixels/9256ddcdf8fbe6d350db to your computer and use it in GitHub Desktop.
Compton Custom Shader Case 3
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
uniform float opacity; | |
uniform bool invert_color; | |
uniform sampler2D tex; | |
void main() { | |
vec4 c = texture2D(tex, gl_TexCoord[0]); | |
float eps = 0.004f; | |
float eps1 = 1.0f / 255.0f; | |
if (invert_color) | |
c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a); | |
if((c.r > 0.2343+eps1-eps && c.r < 0.2343+eps1+eps && | |
c.g > 0.2343+eps1-eps && c.g < 0.2343+eps1+eps && | |
c.b > 0.2343+eps1-eps && c.b < 0.2343+eps1+eps) | |
) | |
{ } | |
else { c *= opacity; } | |
gl_FragColor = c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment