diff --git a/host/Shaders/RGBtoYUV.hlsl b/host/Shaders/RGBtoYUV.hlsl index a6ce5288..e3b73350 100644 --- a/host/Shaders/RGBtoYUV.hlsl +++ b/host/Shaders/RGBtoYUV.hlsl @@ -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; } \ No newline at end of file