You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
295 B

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;
}