Skip to content

Instantly share code, notes, and snippets.

@xseignard
Last active August 29, 2015 13:56
Show Gist options
  • Save xseignard/8802079 to your computer and use it in GitHub Desktop.
Save xseignard/8802079 to your computer and use it in GitHub Desktop.
uniform sampler2D texture;
uniform sampler2D index;
uniform float clicked;
varying vec2 vUv;
void main() {
vec4 currentTexture = texture2D(texture, vUv);
vec4 currentIndex = texture2D(index, vUv);
float fader = 0.0;
if (clicked/currentIndex.r == 1.0) fader = 1.0;
gl_FragColor = mix(currentTexture, currentIndex*255.0, fader);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment