tv.vert 502 B

123456789101112131415161718192021
  1. uniform mat4 u_mvpMatrix;
  2. uniform vec3 texSize; // xy = texSize1, xz = texSize2
  3. in vec4 a_position;
  4. in vec3 a_texCoord;
  5. out vec4 intCoord;
  6. out vec4 cornerCoord0;
  7. out vec4 cornerCoord1;
  8. void main()
  9. {
  10. gl_Position = u_mvpMatrix * a_position;
  11. intCoord.xy = a_texCoord.xy * texSize.xy;
  12. intCoord.zw = -intCoord.xy;
  13. cornerCoord0 = vec4(a_texCoord.xy,
  14. a_texCoord.xy + 1.0 / texSize.xy);
  15. cornerCoord1 = vec4(a_texCoord.xz,
  16. a_texCoord.xz + 1.0 / texSize.xz);
  17. }