shader.vert 432 B

123456789101112131415161718192021222324
  1. #version 450 core
  2. layout(location = 0) in vec2 aPos;
  3. layout(location = 1) in vec2 aUV;
  4. layout(location = 2) in vec4 aColor;
  5. layout(set=1,binding=0) uniform UBO
  6. {
  7. vec2 uScale;
  8. vec2 uTranslate;
  9. } ubo;
  10. layout(location = 0) out struct
  11. {
  12. vec4 Color;
  13. vec2 UV;
  14. } Out;
  15. void main()
  16. {
  17. Out.Color = aColor;
  18. Out.UV = aUV;
  19. gl_Position = vec4(aPos * ubo.uScale + ubo.uTranslate, 0, 1);
  20. gl_Position.y *= -1.0f;
  21. }