I have this shader:
texture tex;
sampler2D s = sampler_state {
texture = <tex>;
};
int tWidth = 1;
int tHeight = 1;
int blurLength = 3;
float4 ps_main(VS_OUTPUT Input) : COLOR0
{
float weight = 1.0 / (blurLength * blurLength);
float2 pxSz = float2(1.0 / tWidth,1.0 / tHeight);
float4 color = Input.Color * tex2D(s, Input.TexCoord.xy);
float4 outC = 0;
int x = 0;
int y = 0;
int numSubtr = (blurLength - 1) / 2;
x -= numSubtr;
y -= numSubtr;
int count = 0;
for(int i = x; i < x + blurLength; ++i)
{
for(int j = y; j < y + blurLength; ++j)
{
outC += Input.Color * tex2D(s, Input.TexCoord.xy + float2(i * pxSz.x,j * pxSz.y)) * weight;
}
}
return outC;
}
When I load it I get:
What could be wrong? (using hlsl ps 2.0 I think)
Thanks