Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- precision mediump float;
- uniform vec3 uLightPos;
- uniform float uxPixelOffset;
- uniform float uyPixelOffset;
- varying vec3 vPosition;
- varying vec4 vColor;
- varying vec3 vNormal;
- void main() {
- vec3 lightVec = uLightPos - vPosition;
- lightVec = normalize(lightVec);
- float specular = pow(max(dot(vNormal, lightVec), 0.0), 5.0);
- float diffuse = max(dot(vNormal, lightVec), 0.1);
- float ambient = 0.3;
- gl_FragColor = (vColor * (diffuse + ambient + specular));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement