Support rendering YUV formatted frames

This commit is contained in:
Martijn Braam
2023-11-24 16:28:25 +01:00
parent 8a3f1a5540
commit 9d189b88b4
10 changed files with 146 additions and 53 deletions

25
data/yuv.vert Normal file
View File

@@ -0,0 +1,25 @@
#ifdef GL_ES
precision mediump float;
#endif
attribute vec2 vert;
attribute vec2 tex_coord;
uniform mat3 transform;
uniform vec2 pixel_size;
varying vec2 top_left_uv;
varying vec2 top_right_uv;
varying vec2 bottom_left_uv;
varying vec2 bottom_right_uv;
void
main()
{
top_left_uv = tex_coord - pixel_size / 2.0;
bottom_right_uv = tex_coord + pixel_size / 2.0;
top_right_uv = vec2(top_left_uv.x, bottom_right_uv.y);
bottom_left_uv = vec2(bottom_right_uv.x, top_left_uv.y);
gl_Position = vec4(transform * vec3(vert, 1), 1);
}