diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2008-06-20 10:27:39 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2008-06-20 10:27:39 +0400 |
commit | 73853394dad7d35f6bb1162084bd97ff8e799533 (patch) | |
tree | 86b954ef0e4d0051f341bc610a08d6a64b712347 /src/apps/mplayerc/res | |
parent | dc754e985cdbcc01e634627e3bc76548522c93fd (diff) |
Fixed : bug in open file dialog filter (after migration to VS2008)
Added : denoise shader
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@583 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/res')
-rw-r--r-- | src/apps/mplayerc/res/shaders/denoise.psh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/apps/mplayerc/res/shaders/denoise.psh b/src/apps/mplayerc/res/shaders/denoise.psh new file mode 100644 index 000000000..b135cc81d --- /dev/null +++ b/src/apps/mplayerc/res/shaders/denoise.psh @@ -0,0 +1,45 @@ +sampler s0 : register(s0);
+float4 p0 : register(c0);
+float4 p1 : register(c1);
+
+#define width (p0[0])
+#define height (p0[1])
+#define counter (p0[2])
+#define clock (p0[3])
+#define one_over_width (p1[0])
+#define one_over_height (p1[1])
+
+#define val0 (1.0)
+#define val1 (0.125)
+
+#define effect_width (0.1)
+
+#define PI acos(-1)
+
+float4 main(float2 tex : TEXCOORD0) : COLOR
+{
+ float dx = 0.0f;
+ float dy = 0.0f;
+ float fTap = effect_width;
+
+ float4 cAccum = tex2D(s0, tex) * val0;
+
+ for ( int iDx = 0 ; iDx < 16; ++iDx )
+ {
+ dx = fTap /width;
+ dy = fTap /height;
+
+ cAccum += tex2D(s0, tex + float2(-dx,-dy)) * val1;
+ cAccum += tex2D(s0, tex + float2(0,-dy)) * val1;
+ cAccum += tex2D(s0, tex + float2(-dx,0)) * val1;
+ cAccum += tex2D(s0, tex + float2(dx,0)) * val1;
+ cAccum += tex2D(s0, tex + float2(0,dy)) * val1;
+ cAccum += tex2D(s0, tex + float2(dx,dy)) * val1;
+ cAccum += tex2D(s0, tex + float2(-dx,+dy)) * val1;
+ cAccum += tex2D(s0, tex + float2(+dx,-dy)) * val1;
+
+ fTap += 0.1f;
+ }
+
+ return(cAccum/16.0f);
+}
\ No newline at end of file |