Created
June 20, 2012 15:10
-
-
Save sortofsleepy/2960388 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
varying vec3 vNormal; | |
varying vec2 vUv; | |
uniform vec3 color; | |
uniform sampler2D texture; | |
void main() { | |
vec3 light = vec3( 0.5, 0.2, 1.0 ); | |
light = normalize( light ); | |
float dProd = dot( vNormal, light ) * 0.5 + 0.5; | |
vec4 tcolor = texture2D( texture, vUv ); | |
vec4 gray = vec4( vec3( tcolor.r * 0.3 + tcolor.g * 0.59 + tcolor.b * 0.11 ), 1.0 ); | |
gl_FragColor = gray * vec4( vec3( dProd ) * vec3( color ), 1.0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment