opengl_vertex.glsl 640 B

123456789101112131415161718192021222324252627
  1. uniform vec2 texelSize0;
  2. #ifdef GL_ES
  3. varying mediump vec2 varTexCoord;
  4. #else
  5. centroid varying vec2 varTexCoord;
  6. #endif
  7. varying vec2 sampleNW;
  8. varying vec2 sampleNE;
  9. varying vec2 sampleSW;
  10. varying vec2 sampleSE;
  11. /*
  12. Based on
  13. https://github.com/mattdesl/glsl-fxaa/
  14. Portions Copyright (c) 2011 by Armin Ronacher.
  15. */
  16. void main(void)
  17. {
  18. varTexCoord.st = inTexCoord0.st;
  19. sampleNW = varTexCoord.st + vec2(-1.0, -1.0) * texelSize0;
  20. sampleNE = varTexCoord.st + vec2(1.0, -1.0) * texelSize0;
  21. sampleSW = varTexCoord.st + vec2(-1.0, 1.0) * texelSize0;
  22. sampleSE = varTexCoord.st + vec2(1.0, 1.0) * texelSize0;
  23. gl_Position = inVertexPosition;
  24. }