!!ARBfp1.0
OPTION ARB_precision_hint_fastest;


# Purpose:


# Input Parameters:
# Tex 0: Frame buffer texture
# TexCoord 0: Texel in the frame buffer
# Env 0: Intensity of the effect.
#	  x: Intensity.
# Env 1: Blur size.
#	  x: Blur size in x direction.
#	  y: Blur size in y direction.
#	  z: 0.0
#	  w: 1.0
# Env 2: Negative blur size.
#	  x: -Blur size in x direction.
#	  y: -Blur size in y direction.
#	  z: 0.0
#	  w: 1.0


TEMP texel0, texel1, texel2, texel3, texel4, finalcolor;

TEMP lookup;

# Make multiple texel lookups
TEX texel0, fragment.texcoord[0], texture[0], 2D;
ADD lookup, fragment.texcoord[0], program.env[1];
TEX texel1, lookup, texture[0], 2D;
ADD lookup, fragment.texcoord[0], program.env[2];
TEX texel2, lookup, texture[0], 2D;
MAD lookup, program.env[1], {2.0, 2.0, 1.0, 1.0}, fragment.texcoord[0];
TEX texel3, lookup, texture[0], 2D;
MAD lookup, program.env[2], {2.0, 2.0, 1.0, 1.0}, fragment.texcoord[0];
TEX texel4, lookup, texture[0], 2D;

# Mix texel lookups.
MUL finalcolor, texel0, 0.3;
MAD finalcolor, texel1, 0.2, finalcolor;
MAD finalcolor, texel2, 0.2, finalcolor;
MAD finalcolor, texel3, 0.15, finalcolor;
MAD finalcolor, texel4, 0.15, finalcolor;

MOV result.color.rgb, finalcolor;
MOV result.color.a, program.env[0].x;

END