#include "Defs.fxh" float4 ScreenSize; sampler2D TexIn; float4 ScreenSpaceLightPos; float4 Scale; float4 Decay; float4 Color; PS3PRAGMA(regcount 16) struct VSInput { float4 vPos : POSITION; float2 tc: TEXCOORD0; }; struct VSOutput { float4 vHPos : POSITION; float4 tc01 : TEXCOORD0; #if NUM_SAMPLES > 2 float4 tc23 : TEXCOORD1; #if NUM_SAMPLES > 4 float4 tc45 : TEXCOORD2; #if NUM_SAMPLES > 6 float4 tc67 : TEXCOORD3; #endif #endif #endif }; VSOutput VShader(in VSInput IN) { VSOutput OUT; OUT.vHPos = IN.vPos; OUT.vHPos.z = 0; ScreenSpaceLightPos.y = 1 - ScreenSpaceLightPos.y; float4 _Scale = Scale * (Scale.z * Scale.z); OUT.tc01.xy = (IN.tc - ScreenSpaceLightPos.xy) * Scale.x + ScreenSpaceLightPos.xy; OUT.tc01.zw = (IN.tc - ScreenSpaceLightPos.xy) * Scale.y + ScreenSpaceLightPos.xy; #if NUM_SAMPLES > 2 OUT.tc23.xy = (IN.tc - ScreenSpaceLightPos.xy) * Scale.z + ScreenSpaceLightPos.xy; OUT.tc23.zw = (IN.tc - ScreenSpaceLightPos.xy) * Scale.w + ScreenSpaceLightPos.xy; #if NUM_SAMPLES > 4 OUT.tc45.xy = (IN.tc - ScreenSpaceLightPos.xy) * _Scale.x + ScreenSpaceLightPos.xy; OUT.tc45.zw = (IN.tc - ScreenSpaceLightPos.xy) * _Scale.y + ScreenSpaceLightPos.xy; #if NUM_SAMPLES > 6 OUT.tc67.xy = (IN.tc - ScreenSpaceLightPos.xy) * _Scale.z + ScreenSpaceLightPos.xy; OUT.tc67.zw = (IN.tc - ScreenSpaceLightPos.xy) * _Scale.w + ScreenSpaceLightPos.xy; #endif #endif #endif return OUT; } float4 PShader(in VSOutput IN) : COLOR0 { float4 rv = 0; float4 _Decay = Decay * (Decay.z*Decay.z/Decay.x/Decay.x); #ifndef FIRST_SAMPLE_BLEND rv += tex2D(TexIn, IN.tc01.xy) * Decay.x; #endif rv += tex2D(TexIn, IN.tc01.zw) * Decay.y; #if NUM_SAMPLES > 2 rv += tex2D(TexIn, IN.tc23.xy) * Decay.z; #endif #if NUM_SAMPLES > 3 rv += tex2D(TexIn, IN.tc23.zw) * Decay.w; #endif #if NUM_SAMPLES > 4 rv += tex2D(TexIn, IN.tc45.xy) * _Decay.x; #endif #if NUM_SAMPLES > 5 rv += tex2D(TexIn, IN.tc45.zw) * _Decay.y; #endif #if NUM_SAMPLES > 6 rv += tex2D(TexIn, IN.tc67.xy) * _Decay.z; #endif #if NUM_SAMPLES > 7 rv += tex2D(TexIn, IN.tc67.zw) * _Decay.w; #endif return rv * Color; } //DEVTEST_TECH(__t1, VSBlur, PSBlurNoDepth)