SimpleVert.glsl 600 B

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