really dont know this special kind of effect. do you have any visual example, on youtube perhaps?
float4 ShadowPass(VSOUT IN) : COLOR0{ float4 Color = 0; float4 tex = 0; float VarOffset = sin(f4Time.x/3600)*5; float4x4 m44projinverse = pow(m44proj,-1); float4x4 m44viewinverse = pow(m44view,-1); //Depth calculations. float depth = tex2D(DepthSampler, IN.UVCoord).x; depth = pow(abs(depth), 0.05f); depth = (2.0f * nearZ) / (nearZ + farZ - depth * (farZ - nearZ)); //Converting a point in screen space to world space. // H is the viewport position at this pixel in the range -1 to 1. float4 H = float4(IN.UVCoord.x * 2 - 1, (1 - IN.UVCoord.y) * 2 - 1, depth, 1); // Transform by the projection inverse to get view space coordinates. float4 D = mul(H, m44projinverse); // Transform by the view inverse to get world space coordinates. D = mul(D, m44viewinverse); // Divide by w to get the world position. float4 worldPos = D / D.w; //Distance from origin in world space - anologue of depth in screen space. float worldPosDist = sqrt(pow(worldPos.x,2) + pow(worldPos.y,2) + pow(worldPos.z,2)); float4 proj = float4(IN.UVCoord.x, IN.UVCoord.y,0,worldPosDist); for (int i = 0; i < 13; i++) { //Y axis blur. float Multiplier = BlurMagnitude * BlurWeights[i] * float2(0,1); tex = tex2Dproj(TextureSampler, proj + float4(BlurOffsets[i].x,BlurOffsets[i].y,0,0) * Multiplier + VarOffset); tex.rgb = dot(greyscale,tex.rgb) / 3; if (tex.r < 0.27) tex.rgb = 0; Color += tex; //X axis blur. Multiplier = BlurMagnitude * BlurWeights[i] * float2(1,0); tex = tex2Dproj(TextureSampler, proj + float4(BlurOffsets[i].x,BlurOffsets[i].y,0,0) * Multiplier + VarOffset); tex.rgb = dot(greyscale,tex.rgb) / 3; if (tex.r < 0.27) tex.rgb = 0; Color += tex; } if (depth == 1) Color = 0; return Color / 26;}
float4 UVCoord : TEXCOORD0;