aboutsummaryrefslogtreecommitdiff
path: root/musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx
downloadcli-tools-windows-master.tar.gz
cli-tools-windows-master.tar.bz2
cli-tools-windows-master.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx')
-rw-r--r--musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx61
1 files changed, 61 insertions, 0 deletions
diff --git a/musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx b/musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx
new file mode 100644
index 0000000..c212e06
--- /dev/null
+++ b/musikcube_win32_with_milkdrop2_0.98.1/plugins/Milkdrop2/data/blur2_ps.fx
@@ -0,0 +1,61 @@
+//texture PrevFrameImage;
+//sampler2D sampler_main = sampler_state { Texture = <PrevFrameImage>; };
+//float4 _c0; // source texsize (.xy), and inverse (.zw)
+
+
+
+
+//float4 _c5; // w1,w2,d1,d2
+//float4 _c6; // w_div, edge_darken_c1, edge_darken_c2, edge_darken_c3
+
+void PS( float2 uv : TEXCOORD,
+ out float4 ret : COLOR0 )
+{
+ //SHORT VERTICAL PASS 2:
+ //const float w1 = w[0]+w[1] + w[2]+w[3];
+ //const float w2 = w[4]+w[5] + w[6]+w[7];
+ //const float d1 = 0 + 2*((w[2]+w[3])/w1);
+ //const float d2 = 2 + 2*((w[6]+w[7])/w2);
+ //const float w_div = 1.0/((w1+w2)*2);
+
+
+
+
+
+ #define srctexsize _c0
+ #define w1 _c5.x
+ #define w2 _c5.y
+
+
+ #define d1 _c5.z
+ #define d2 _c5.w
+
+
+ #define edge_darken_c1 _c6.y
+ #define edge_darken_c2 _c6.z
+ #define edge_darken_c3 _c6.w
+
+ #define w_div _c6.x
+
+ // note: if you just take one sample at exactly uv.xy, you get an avg of 4 pixels.
+ //float2 uv2 = uv.xy;// + srctexsize.zw*float2(-0.5,-0.5);
+ float2 uv2 = uv.xy + srctexsize.zw*float2(1,0); // + moves blur UP, LEFT by TWO-pixel increments! (since texture is 1/2 the size of blur1_ps)
+
+ float3 blur =
+ ( tex2D( sampler_main, uv2 + float2(0, d1*srctexsize.w) ).xyz
+ + tex2D( sampler_main, uv2 + float2(0,-d1*srctexsize.w) ).xyz)*w1 +
+ ( tex2D( sampler_main, uv2 + float2(0, d2*srctexsize.w) ).xyz
+ + tex2D( sampler_main, uv2 + float2(0,-d2*srctexsize.w) ).xyz)*w2
+ ;
+ blur.xyz *= w_div;
+
+ // tone it down at the edges: (only happens on 1st X pass!)
+ float t = min( min(uv.x, uv.y), 1-max(uv.x,uv.y) );
+ t = sqrt(t);
+ t = edge_darken_c1 + edge_darken_c2*saturate(t*edge_darken_c3);
+ blur.xyz *= t;
+
+ ret.xyz = blur;
+ ret.w = 1;
+ //ret.xyzw = tex2D(sampler_main, uv + 0*srctexsize.zw);
+}