uniform vec3 U_EyePos; varying vec3 V_Normal; varying vec3 V_WorldPos; void main() { vec3 N = normalize(V_Normal); vec3 L = normalize(U_EyePos - V_WorldPos); float cosThta = dot(N,L); float alpha = 0.0; if(cosThta > 0.0){ alpha = 1 - cosThta; } gl_FragColor = vec4(0.6) * alpha; }