cur.vert 402 B

123456789101112131415161718192021222324
  1. #version 330 core
  2. uniform float time;
  3. uniform vec2 resolution;
  4. uniform vec2 camera;
  5. uniform vec2 pos;
  6. uniform float h;
  7. uniform float w;
  8. out vec2 uv;
  9. vec2 project_point(vec2 point)
  10. {
  11. return (2.0 * (point - camera)) / resolution;
  12. }
  13. void main()
  14. {
  15. uv = vec2(float(gl_VertexID & 1),
  16. float((gl_VertexID >> 1) & 1));
  17. uv = uv * vec2(w, h) + pos;
  18. gl_Position = vec4(project_point(uv), 0.0, 1.0);
  19. }