Geen omschrijving

base.frag 799B

1234567891011121314151617181920212223242526272829
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (binding = 2) uniform sampler2D colorMap;
  5. layout (location = 0) in vec3 inNormal;
  6. layout (location = 1) in vec2 inUV;
  7. layout (location = 2) in vec3 inEyePos;
  8. layout (location = 3) in vec3 inLightVec;
  9. layout (location = 0) out vec4 outFragColor;
  10. void main()
  11. {
  12. vec3 N = normalize(inNormal);
  13. vec3 L = normalize(vec3(1.0));
  14. outFragColor.rgb = texture(colorMap, inUV).rgb;
  15. vec3 Eye = normalize(-inEyePos);
  16. vec3 Reflected = normalize(reflect(-inLightVec, inNormal));
  17. vec4 IAmbient = vec4(0.0, 0.0, 0.0, 1.0);
  18. vec4 IDiffuse = vec4(1.0) * max(dot(inNormal, inLightVec), 0.0);
  19. outFragColor = vec4((IAmbient + IDiffuse) * vec4(texture(colorMap, inUV).rgb, 1.0));
  20. }