!!ARBfp1.0

ATTRIB tex0 = fragment.texcoord[0];
ATTRIB tex1 = fragment.texcoord[1];
ATTRIB tex2 = fragment.texcoord[2];
ATTRIB tex3 = fragment.texcoord[3];

OUTPUT out  = result.color;

PARAM const0 = program.local[0];

TEMP discard1;
TEMP discard2;
TEMP spare0;
TEMP t0;
TEMP t1;
TEMP t2;
TEMP t3;

# Get texel values for all four stages
TEX t0, tex0, texture[0], 2D;
TEX t1, tex1, texture[1], 2D;
TEX t2, tex2, texture[2], 2D;
TEX t3, tex3, texture[3], 2D;

# Combine all four texture stages
MUL spare0, t0, const0;

MUL discard1, t1, const0;
MOV discard2, spare0;
ADD spare0, discard1, discard2;

MUL discard1, t2, const0;
MOV discard2, spare0;
ADD spare0, discard1, discard2;

MUL discard1, t3, const0;
MOV discard2, spare0;
ADD spare0, discard1, discard2;

# Output the final colour
MOV out, spare0;
END
