Last active
May 3, 2016 16:03
-
-
Save Samsy/036f01b38b5d61e91cc537b740aefcbd to your computer and use it in GitHub Desktop.
Branching
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
varying vec2 vUv; | |
uniform sampler2D tDiffuse; | |
uniform float isPicking; | |
uniform vec3 pickingColor; | |
void main() { | |
vec3 color = texture2D(tDiffuse, vUv).rgb; | |
gl_FragColor = vec4(color, 1.0); | |
} |
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
varying vec2 vUv; | |
uniform sampler2D tDiffuse; | |
uniform float isPicking; | |
uniform vec3 pickingColor; | |
void main() { | |
gl_FragColor = vec4(pickingColor, 1.0); | |
} |
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
varying vec2 vUv; | |
uniform sampler2D tDiffuse; | |
uniform float isPicking; | |
uniform vec3 pickingColor; | |
void main() { | |
if( isPicking == 0.0 ) { | |
vec3 color = texture2D(tDiffuse, vUv).rgb; | |
gl_FragColor = vec4(color, 1.0); | |
} | |
else { | |
gl_FragColor = vec4(pickingColor, 1.0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment