diff options
author | elupus <elupus@svn> | 2009-11-04 00:26:46 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2009-11-04 00:26:46 +0000 |
commit | 109210a142f5dd3cf26f1cddb270c9b49e63a4d5 (patch) | |
tree | 0d9d0aedc4322a552f5bf55500b1e04d0a980d78 /system/shaders | |
parent | 055151de32f42c8e16d12d19f3b771b2c2a18a37 (diff) |
added: brightness and contrast support for d3d renderer
added: support different color spaces for d3d renderer
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@24256 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/yuv2rgb_d3d.fx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/system/shaders/yuv2rgb_d3d.fx b/system/shaders/yuv2rgb_d3d.fx index 1632b93613..6d5aab954b 100644 --- a/system/shaders/yuv2rgb_d3d.fx +++ b/system/shaders/yuv2rgb_d3d.fx @@ -1,6 +1,7 @@ texture g_YTexture; texture g_UTexture; texture g_VTexture; +float4x4 g_ColorMatrix; sampler YSampler = sampler_state { @@ -49,12 +50,11 @@ struct PS_OUTPUT PS_OUTPUT YUV2RGB( VS_OUTPUT In) { PS_OUTPUT OUT; - float3 YUV = float3(tex2D (YSampler, In.TextureY).x - (16.0 / 256.0) - , tex2D (USampler, In.TextureU).x - (128.0 / 256.0) - , tex2D (VSampler, In.TextureV).x - (128.0 / 256.0)); - OUT.RGBColor.r = clamp((1.164 * YUV.x + 1.596 * YUV.z),0,255); - OUT.RGBColor.g = clamp((1.164 * YUV.x - 0.813 * YUV.z - 0.391 * YUV.y), 0,255); - OUT.RGBColor.b = clamp((1.164 * YUV.x + 2.018 * YUV.y),0,255); + float4 YUV = float4(tex2D (YSampler, In.TextureY).x + , tex2D (USampler, In.TextureU).x + , tex2D (VSampler, In.TextureV).x + , 1.0); + OUT.RGBColor = mul(YUV, g_ColorMatrix); OUT.RGBColor.a = 1.0; return OUT; } |