colortexturedquad.vert 482 B

12345678910111213141516171819202122232425
  1. uniform vec2 center;
  2. uniform vec2 size;
  3. uniform vec2 texcenter;
  4. uniform vec2 texsize;
  5. #if __VERSION__ >= 330
  6. layout(location=0) in vec2 Position;
  7. layout(location=3) in vec2 Texcoord;
  8. layout(location=2) in uvec4 Color;
  9. #else
  10. in vec2 Position;
  11. in vec2 Texcoord;
  12. in uvec4 Color;
  13. #endif
  14. out vec2 uv;
  15. out vec4 col;
  16. void main()
  17. {
  18. col = vec4(Color) / 255.;
  19. uv = Texcoord * texsize + texcenter;
  20. gl_Position = vec4(Position * size + center, 0., 1.);
  21. }