Quad.vert.glsl 571 B

1234567891011121314151617181920212223242526
  1. // Copyright (C) 2009-2017, 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. #if !defined(UV_OFFSET)
  7. #define UV_OFFSET (0.0)
  8. #endif
  9. out gl_PerVertex
  10. {
  11. vec4 gl_Position;
  12. };
  13. layout(location = 0) out vec2 out_uv;
  14. void main()
  15. {
  16. const vec2 POSITIONS[3] = vec2[](vec2(-1.0, -1.0), vec2(3.0, -1.0), vec2(-1.0, 3.0));
  17. vec2 pos = POSITIONS[gl_VertexID];
  18. out_uv = pos * 0.5 + (0.5 + UV_OFFSET);
  19. ANKI_WRITE_POSITION(vec4(pos, 0.0, 1.0));
  20. }