QuadVert.glsl 439 B

123456789101112131415161718192021
  1. // Copyright (C) 2009-2020, 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. const Vec2 pos = out_uv * 2.0 - 1.0;
  15. gl_Position = Vec4(pos, 0.0, 1.0);
  16. }