yuv.vert 548 B

12345678910111213141516171819202122232425
  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
  13. main()
  14. {
  15. top_left_uv = tex_coord - pixel_size / 2.0;
  16. bottom_right_uv = tex_coord + pixel_size / 2.0;
  17. top_right_uv = vec2(top_left_uv.x, bottom_right_uv.y);
  18. bottom_left_uv = vec2(bottom_right_uv.x, top_left_uv.y);
  19. gl_Position = vec4(transform * vec3(vert, 1), 1);
  20. }