QuadVert.glsl 433 B

123456789101112131415161718192021
  1. // Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include "shaders/Common.glsl"
  6. out gl_PerVertex
  7. {
  8. vec4 gl_Position;
  9. };
  10. layout(location = 0) out vec2 out_uv;
  11. void main()
  12. {
  13. out_uv = vec2(gl_VertexID & 1, gl_VertexID >> 1) * 2.0;
  14. vec2 pos = out_uv * 2.0 - 1.0;
  15. gl_Position = vec4(pos, 0.0, 1.0);
  16. }