debayer.vert 533 B

1234567891011121314151617181920212223
  1. #ifdef GL_ES
  2. precision mediump float;
  3. #endif
  4. attribute vec2 vert;
  5. attribute vec2 tex_coord;
  6. uniform mat3 transform;
  7. uniform vec2 pixel_size;
  8. varying vec2 top_left_uv;
  9. varying vec2 top_right_uv;
  10. varying vec2 bottom_left_uv;
  11. varying vec2 bottom_right_uv;
  12. void main() {
  13. top_left_uv = tex_coord - pixel_size / 2.0;
  14. bottom_right_uv = tex_coord + pixel_size / 2.0;
  15. top_right_uv = vec2(top_left_uv.x, bottom_right_uv.y);
  16. bottom_left_uv = vec2(bottom_right_uv.x, top_left_uv.y);
  17. gl_Position = vec4(transform * vec3(vert, 1), 1);
  18. }