mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-07-05 20:42:08 -07:00
Make YUV/RGB conversion more accurate
This commit is contained in:
parent
2b6a41957a
commit
c40b5a95d1
1 changed files with 5 additions and 5 deletions
|
@ -54,13 +54,13 @@ out vec4 out_color;
|
|||
void main()
|
||||
{
|
||||
vec3 yuv = vec3(
|
||||
texture(tex_y, uv_var).r,
|
||||
texture(tex_u, uv_var).r - 0.5,
|
||||
texture(tex_v, uv_var).r - 0.5);
|
||||
(texture(tex_y, uv_var).r - (16.0 / 255.0)) / ((235.0 - 16.0) / 255.0),
|
||||
(texture(tex_u, uv_var).r - (16.0 / 255.0)) / ((240.0 - 16.0) / 255.0) - 0.5,
|
||||
(texture(tex_v, uv_var).r - (16.0 / 255.0)) / ((240.0 - 16.0) / 255.0) - 0.5);
|
||||
vec3 rgb = mat3(
|
||||
1.0, 1.0, 1.0,
|
||||
0.0, -0.39393, 2.02839,
|
||||
1.14025, -0.58081, 0.0) * yuv;
|
||||
0.0, -0.21482, 2.12798,
|
||||
1.28033, -0.38059, 0.0) * yuv;
|
||||
out_color = vec4(rgb, 1.0);
|
||||
}
|
||||
)glsl";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue