mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[host] correct RGBtoYUV shader output
This commit is contained in:
parent
63b4dd633c
commit
b899a65726
@ -19,13 +19,13 @@ OUT main(VS input)
|
|||||||
OUT o;
|
OUT o;
|
||||||
const float4 rgba = texTexture.Sample(texSampler, input.tex);
|
const float4 rgba = texTexture.Sample(texSampler, input.tex);
|
||||||
|
|
||||||
o.y.gba = 0.0f;
|
o.y.gba = 1.0f;
|
||||||
o.u.gba = 0.0f;
|
o.u.gba = 1.0f;
|
||||||
o.v.gba = 0.0f;
|
o.v.gba = 1.0f;
|
||||||
|
|
||||||
o.y.r = rgba.r * 0.2126 + 0.7152 * rgba.g + 0.0722 * rgba.b;
|
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.u.r = ((rgba.b - o.y.r) / 1.8556) + 0.5;
|
||||||
o.v.r = (rgba.r - o.y.r) / 1.5748;
|
o.v.r = ((rgba.r - o.y.r) / 1.5748) + 0.5;
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user