Easy lambertian shading
| #version 100 | |
| precision mediump float; | |
| varying vec3 normal; | |
| varying vec2 texCoord; | |
| uniform sampler2D texture; | |
| const vec3 light = vec3(0.21821789023, 0.43643578047, 0.87287156094); | |
| void main() | |
| { | |
| float costheta = dot(normal, light); | |
| vec3 col = max(costheta, 0.0) * texture2D(texture, texCoord).rgb; | |
| gl_FragColor = vec4(col, 1.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment