2
0

SimpleVert.glsl 594 B

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