[host] correct RGBtoYUV shader output

This commit is contained in:
Geoffrey McRae 2018-07-28 07:47:49 +10:00
parent 63b4dd633c
commit b899a65726

View File

@ -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;
} }