Last active
August 29, 2015 13:56
-
-
Save xseignard/8802079 to your computer and use it in GitHub Desktop.
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 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