Guest User

Untitled

a guest
Jul 10th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. // VERTEX
  2. #version 450 core
  3. layout(location = 0) in vec2 pos;
  4. layout(location = 1) in vec2 uv;
  5. layout(location = 2) in vec4 color;
  6. layout(push_constant) uniform uPushConstant {
  7. vec2 uScale;
  8. vec2 uTranslate;
  9. } pc;
  10.  
  11. out gl_PerVertex {
  12. vec4 gl_Position;
  13. };
  14. layout(location = 0) out struct {
  15. vec4 Color;
  16. vec2 UV;
  17. } Out;
  18.  
  19. void main() {
  20. Out.Color = color;
  21. Out.UV = uv;
  22. gl_Position = vec4(pos * pc.uScale + pc.uTranslate, 0, 1);
  23. }
  24.  
  25. // FRAGMENT
  26. #version 450 core
  27. layout(location = 0) out vec4 color;
  28. layout(set = 0, binding = 0) uniform sampler2D sTexture;
  29. layout(location = 0) in struct {
  30. vec4 Color;
  31. vec2 UV;
  32. } In;
  33. void main() {
  34. color = In.Color * texture(sTexture, In.UV.st);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment