Ingen beskrivning

attachmentwrite.vert 640B

1234567891011121314151617181920212223242526272829
  1. #version 450
  2. layout (location = 0) in vec3 inPos;
  3. layout (location = 1) in vec3 inColor;
  4. layout (location = 2) in vec3 inNormal;
  5. layout (binding = 0) uniform UBO {
  6. mat4 projection;
  7. mat4 model;
  8. mat4 view;
  9. } ubo;
  10. layout (location = 0) out vec3 outColor;
  11. layout (location = 1) out vec3 outNormal;
  12. layout (location = 2) out vec3 outViewVec;
  13. layout (location = 3) out vec3 outLightVec;
  14. out gl_PerVertex {
  15. vec4 gl_Position;
  16. };
  17. void main()
  18. {
  19. gl_Position = ubo.projection * ubo.view * ubo.model * vec4(inPos, 1.0);
  20. outColor = inColor;
  21. outNormal = inNormal;
  22. outLightVec = vec3(0.0f, 5.0f, 15.0f) - inPos;
  23. outViewVec = -inPos.xyz;
  24. }