I have YUV to RGB conversion shader.
struct Pixel_INPUT
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD0;
};
Texture2D textureY : register(t0);
Texture2D textureU : register(t1);
Texture2D textureV : register(t2);
SamplerState samstate
{
MinFilter = Anisotropic;
MagFilter = Anisotropic;
AddressU = Clamp;
AddressV = Clamp;
};
float4 PS(Pixel_INPUT input) : SV_Target
{
float y = (1.1643f * textureY.Sample(samstate,input.tex) - 0.0625f);
float u = textureU.Sample(samstate,input.tex) - 0.5f;
float v = textureV.Sample(samstate,input.tex) - 0.5f;
float r = y + 1.5958f * v;
float g = y - 0.39173f * u - 0.81290f * v;
float b = y + 2.017f * u;
return float4(r,g,b,1);
}
But I have a green line at right side of image like that:
I use Clamp address mode and image is more yellow color than the original.