Created
July 26, 2015 14:19
-
-
Save pomle/136024f4dd91d78c1fb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 vec3 sColor1; | |
uniform vec3 dColor1; | |
uniform vec3 sColor2; | |
uniform vec3 dColor2; | |
uniform sampler2D texture; | |
varying vec2 vUv; | |
void main() { | |
vec4 tColor = texture2D( texture, vUv ); | |
if (tColor.x == sColor1.x && tColor.y == sColor1.y && tColor.z == sColor1.z) { | |
tColor.x = dColor1.x; | |
tColor.y = dColor1.y; | |
tColor.z = dColor1.z; | |
} | |
if (tColor.x == sColor2.x && tColor.y == sColor2.y && tColor.z == sColor2.z) { | |
tColor.x = dColor2.x; | |
tColor.y = dColor2.y; | |
tColor.z = dColor2.z; | |
} | |
gl_FragColor = tColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment