Skip to content

Instantly share code, notes, and snippets.

@quadpixels
quadpixels / gist:9256ddcdf8fbe6d350db
Created May 12, 2015 07:15
Compton Custom Shader Case 3
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);
@quadpixels
quadpixels / gist:62a621bd7124125ab4f2
Created May 12, 2015 07:13
Compton Custom Shader Case 4
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);