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.

19 lines
295 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. uniform vec3 U_EyePos;
  2. varying vec3 V_Normal;
  3. varying vec3 V_WorldPos;
  4. void main()
  5. {
  6. vec3 N = normalize(V_Normal);
  7. vec3 L = normalize(U_EyePos - V_WorldPos);
  8. float cosThta = dot(N,L);
  9. float alpha = 0.0;
  10. if(cosThta > 0.0){
  11. alpha = 1 - cosThta;
  12. }
  13. gl_FragColor = vec4(0.6) * alpha;
  14. }