layer.vertex.fx 342 B

1234567891011121314151617181920
  1. #ifdef GL_ES
  2. precision highp float;
  3. #endif
  4. // Attributes
  5. attribute vec2 position;
  6. // Uniforms
  7. uniform mat4 textureMatrix;
  8. // Output
  9. varying vec2 vUV;
  10. const vec2 madd = vec2(0.5, 0.5);
  11. void main(void) {
  12. vUV = vec2(textureMatrix * vec4(position * madd + madd, 1.0, 0.0));
  13. gl_Position = vec4(position, 0.0, 1.0);
  14. }