!!ATIfs1.0

StartConstants;

CONSTANT c1 = 0.265;
CONSTANT c2 = 0.195;
CONSTANT c3 = 0.135;
CONSTANT c4 = 0.095;

EndConstants;

StartPrelimPass;

SampleMap	r0, t0.str;
SampleMap	r1, t1.str;
SampleMap	r2, t2.str;
SampleMap	r3, t3.str;
SampleMap	r4, t4.str;
SampleMap	r5, t5.str;

MUL r0.rgb, r0, r0.a;
MUL r1.rgb, r1, r1.a;
MUL r2.rgb, r2, r2.a;
MUL r3.rgb, r3, r3.a;
MUL r4.rgb, r4, r4.a;
MUL r5.rgb, r5, r5.a;

EndPass;

StartOutputPass;

PassTexCoord	r0, r0.str;
PassTexCoord	r1, r1.str;
PassTexCoord	r2, r2.str;
PassTexCoord	r3, r3.str;
PassTexCoord	r4, r4.str;
PassTexCoord	r5, r5.str;

MUL r0.rgb, r0, c2;
MAD r0.rgb, r1, c2, r0;
MAD r0.rgb, r2, c3, r0;
MAD r0.rgb, r3, c3, r0;
MAD r0.rgb, r4, c4, r0;
MAD r0.rgb.2x, r5, c1, r0;

EndPass;
