mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 14:23:57 +00:00
[host] correct RGBtoYUV shader output
This commit is contained in:
parent
63b4dd633c
commit
b899a65726
1 changed files with 5 additions and 5 deletions
|
@ -19,13 +19,13 @@ OUT main(VS input)
|
|||
OUT o;
|
||||
const float4 rgba = texTexture.Sample(texSampler, input.tex);
|
||||
|
||||
o.y.gba = 0.0f;
|
||||
o.u.gba = 0.0f;
|
||||
o.v.gba = 0.0f;
|
||||
o.y.gba = 1.0f;
|
||||
o.u.gba = 1.0f;
|
||||
o.v.gba = 1.0f;
|
||||
|
||||
o.y.r = rgba.r * 0.2126 + 0.7152 * rgba.g + 0.0722 * rgba.b;
|
||||
o.u.r = (rgba.b - o.y.r) / 1.8556;
|
||||
o.v.r = (rgba.r - o.y.r) / 1.5748;
|
||||
o.u.r = ((rgba.b - o.y.r) / 1.8556) + 0.5;
|
||||
o.v.r = ((rgba.r - o.y.r) / 1.5748) + 0.5;
|
||||
|
||||
return o;
|
||||
}
|
Loading…
Reference in a new issue