texturedquad.vert 381 B

1234567891011121314151617181920
  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. #else
  9. in vec2 Position;
  10. in vec2 Texcoord;
  11. #endif
  12. out vec2 uv;
  13. void main()
  14. {
  15. uv = Texcoord * texsize + texcenter;
  16. gl_Position = vec4(Position * size + center, 0., 1.);
  17. }