SimpleVert.glsl 645 B

123456789101112131415161718192021
  1. /**
  2. * Simple vertex shader for IS and PPS stages. It is used for rendering a quad in the
  3. * screen. Notice that it does not use ftransform(). We dont need it because we can
  4. * get the Normalized Display Coordinates ([-1,1]) simply by looking in the vertex
  5. * position. The vertex positions of the quad are from 0.0 to 1.0 for both axis.
  6. */
  7. #pragma anki attribute position 0
  8. attribute vec2 position;
  9. varying vec2 texCoords;
  10. void main()
  11. {
  12. vec2 vertPos = position; // the vert coords are {1.0,1.0}, {0.0,1.0}, {0.0,0.0}, {1.0,0.0}
  13. texCoords = vertPos;
  14. vec2 vertPosNdc = vertPos*2.0 - 1.0;
  15. gl_Position = vec4( vertPosNdc, 0.0, 1.0 );
  16. }