No Description

logo.frag 619B

12345678910111213141516171819202122
  1. #version 450
  2. layout (location = 0) in vec2 inUV;
  3. layout (location = 1) in vec3 inNormal;
  4. layout (location = 2) in vec3 inColor;
  5. layout (location = 3) in vec3 inEyePos;
  6. layout (location = 4) in vec3 inLightVec;
  7. layout (location = 0) out vec4 outFragColor;
  8. void main()
  9. {
  10. vec3 Eye = normalize(-inEyePos);
  11. vec3 Reflected = normalize(reflect(-inLightVec, inNormal));
  12. vec4 diff = vec4(inColor, 1.0) * max(dot(inNormal, inLightVec), 0.0);
  13. float shininess = 0.0;
  14. vec4 spec = vec4(1.0, 1.0, 1.0, 1.0) * pow(max(dot(Reflected, Eye), 0.0), 2.5) * shininess;
  15. outFragColor = diff + spec;
  16. outFragColor.a = 1.0;
  17. }