diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-08-22 23:15:42 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-08-22 23:15:42 +0400 |
commit | e114608ee363d7bdc1c849bf73cf24f5224fa5db (patch) | |
tree | 80d90cb8f55903d9f984f4171901617e5eae127f /src/apps/mplayerc/res | |
parent | 27d2869d265b4f07d83c75cc6c492ecb2d7d5184 (diff) |
NEW : Full ICC color management (Little CMS library added)
NEW : Full floating point processing (FP16 temporary textures)
NEW : High-quality dithering (color management, full floating point processing, 10-bit -> 8-bit)
NEW : Option to force 10-bit EVR mixer input (probably hackish, but in many cases it seems to work)
CHANGED: Core rendering code in the DX9AllocatorPresenter class moved to a new class: DX9RenderingEngine
CHANGED: "10 bit RGB" option changed to "10-bit RGB Output", does not affect internal processing anymore
CHANGED: Removed unnecessary temporary texture allocations
FIXED : The EVR mixer output media subtype matches the surface format (as a consequence, it's always RGB)
Thanks to Attila T. Áfra <attila.afra@gmail.com> for this huge patch!
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2299 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/res')
-rw-r--r-- | src/apps/mplayerc/res/mplayerc.rc2 | 1 | ||||
-rw-r--r-- | src/apps/mplayerc/res/shaders/final.psh | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/apps/mplayerc/res/mplayerc.rc2 b/src/apps/mplayerc/res/mplayerc.rc2 index 08c3f71fd..9d76c0103 100644 --- a/src/apps/mplayerc/res/mplayerc.rc2 +++ b/src/apps/mplayerc/res/mplayerc.rc2 @@ -94,6 +94,7 @@ IDF_CONTROLVOLUMEOFF_PNG FILE "res\\web\\controlvolum IDF_CONTROLVOLUMEBAR_PNG FILE "res\\web\\controlvolumebar.png"
IDF_CONTROLVOLUMEGRIP_PNG FILE "res\\web\\controlvolumegrip.png"
IDF_SHADER_RESIZER FILE "res\\shaders\\resizer.psh"
+IDF_SHADER_FINAL FILE "res\\shaders\\final.psh"
IDF_LOGO0 FILE "res\\logo.0.png"
#ifdef _WIN64
diff --git a/src/apps/mplayerc/res/shaders/final.psh b/src/apps/mplayerc/res/shaders/final.psh new file mode 100644 index 000000000..96eccb562 --- /dev/null +++ b/src/apps/mplayerc/res/shaders/final.psh @@ -0,0 +1,30 @@ +#define LUT3D_ENABLED (_LUT3D_ENABLED_VALUE_)
+
+sampler image : register(s0);
+
+sampler ditherMatrix : register(s1);
+float2 ditherMatrixCoordScale : register(c0);
+
+// Maximum quantized integer value
+static const float QUANTIZATION = _QUANTIZATION_VALUE_;
+
+#if LUT3D_ENABLED
+sampler lut3D : register(s2);
+static const float LUT3D_SIZE = _LUT3D_SIZE_VALUE_;
+
+// 3D LUT texture coordinate scale and offset required for correct linear interpolation
+static const float LUT3D_SCALE = (LUT3D_SIZE - 1.0f) / LUT3D_SIZE;
+static const float LUT3D_OFFSET = 1.0f / (2.0f * LUT3D_SIZE);
+#endif
+
+float4 main(float2 imageCoord : TEXCOORD0) : COLOR
+{
+ float4 pixel = tex2D(image, imageCoord);
+
+#if LUT3D_ENABLED
+ pixel = tex3D(lut3D, pixel.rgb * LUT3D_SCALE + LUT3D_OFFSET);
+#endif
+
+ float4 ditherValue = tex2D(ditherMatrix, imageCoord * ditherMatrixCoordScale);
+ return floor(pixel * QUANTIZATION + ditherValue) / QUANTIZATION;
+}
|