Geen omschrijving

indirectdraw.frag 536B

1234567891011121314151617181920
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (location = 0) in vec3 inNormal;
  5. layout (location = 1) in vec3 inColor;
  6. layout (location = 2) in vec3 inViewVec;
  7. layout (location = 3) in vec3 inLightVec;
  8. layout (location = 0) out vec4 outFragColor;
  9. void main()
  10. {
  11. vec3 N = normalize(inNormal);
  12. vec3 L = normalize(inLightVec);
  13. vec3 ambient = vec3(0.25);
  14. vec3 diffuse = vec3(max(dot(N, L), 0.0));
  15. outFragColor = vec4((ambient + diffuse) * inColor, 1.0);
  16. }