!!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: Pixel size.
#	  x: Pixel size.
#	  y: 1/Pixel size.


TEMP framebuffer;

# Pixelate texel lookup
TEMP lookup;

MUL lookup, fragment.texcoord[0], program.env[1].x;
FLR lookup, lookup;
MUL lookup, lookup, program.env[1].y;
MOV lookup.zw, {0.0, 0.0, 0.0, 1.0};

TEX framebuffer, lookup, texture[0], 2D;

MUL framebuffer, framebuffer, 4.0;
FLR framebuffer, framebuffer;
MUL framebuffer, framebuffer, 0.25;

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

END
