!!ARBvp1.0 
OPTION ARB_position_invariant;

TEMP R0, R1, R2;

PARAM defaultTexCoord = { 0, 0.5, 0, 1 };

SUB R0, program.env[4], vertex.position;

DP3 result.texcoord[0].x, vertex.attrib[9], R0;
DP3 result.texcoord[0].y, vertex.attrib[10], R0;
DP3 result.texcoord[0].z, vertex.attrib[11], R0;
MOV result.texcoord[1], defaultTexCoord;
DP4 result.texcoord[1].x, vertex.attrib[8], program.env[10];
DP4 result.texcoord[1].y, vertex.attrib[8], program.env[11];
MOV result.texcoord[2], defaultTexCoord;
DP4 result.texcoord[2].x, vertex.position, program.env[9];
DP4 result.texcoord[3].x, vertex.position, program.env[6];
DP4 result.texcoord[3].y, vertex.position, program.env[7];
DP4 result.texcoord[3].w, vertex.position, program.env[8];
MOV result.texcoord[4], defaultTexCoord;
DP4 result.texcoord[4].x, vertex.attrib[8], program.env[12];
DP4 result.texcoord[4].y, vertex.attrib[8], program.env[13];
MOV result.texcoord[5], defaultTexCoord;
DP4 result.texcoord[5].x, vertex.attrib[8], program.env[14];
DP4 result.texcoord[5].y, vertex.attrib[8], program.env[15];

DP3 R1, R0, R0;
RSQ R1, R1.x;
MUL R0, R0, R1.x;

SUB R1, program.env[5], vertex.position;

DP3 R2, R1, R1;
RSQ R2, R2.x;
MAD R0, R1, R2.x, R0;

DP3 result.texcoord[6].x, vertex.attrib[9], R0;
DP3 result.texcoord[6].y, vertex.attrib[10], R0;
DP3 result.texcoord[6].z, vertex.attrib[11], R0;
DP3 result.texcoord[7].x, vertex.attrib[9], R1;
DP3 result.texcoord[7].y, vertex.attrib[10], R1;
DP3 result.texcoord[7].z, vertex.attrib[11], R1;

#MAD		result.color.xyz, vertex.color, program.env[16].x, program.env[16].y;
MAD		result.color.xyz, vertex.color, program.env[16], program.env[17];

END

#======================================================================

!!ARBfp1.0 
OPTION ARB_precision_hint_nicest;
OPTION NV_fragment_program2;

SHORT TEMP light, color, R1, R2, R3, R4, R5, localNormal, specular;
TEMP view, view2, sample, height, R0, tmp, offset, Noffset, Toffset, Soffset, Eoffset;

PARAM subOne = { -1, -1, -1, -1 };
PARAM scaleTwo = { 2, 2, 2, 2 };

NRMH view, fragment.texcoord[7];
MOVH view2.z, view.z;
RCPH tmp.x, view2.z;
MULH view2.xy, view, 0.03;
MULH view2, view2, -tmp.x;
MULH view2, view2, 0.015;
MOVH R0.xy, fragment.texcoord[1];
MOVH R0.z, 1.0;

TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;
ADDH R0(GT.w), R0, view2;
TEX sample, R0, texture[1], 2D;
SGTHC R3.w, R0.z, sample.z;

ADDH R0(GT.w), R0, view2;
MADH offset.x, R0.z, 0.0375, -0.0375;
MAD Noffset, offset.xxxx, view, fragment.texcoord[1];
MAD Toffset, offset.xxxx, view, fragment.texcoord[4];
MAD Soffset, offset.xxxx, view, fragment.texcoord[5];
NRMH specular, fragment.texcoord[6];
NRMH light, fragment.texcoord[0];

TEX localNormal, Noffset, texture[1], 2D;
MOVH localNormal.x, localNormal.a;
MOVH localNormal.z, 0.75;
MADH localNormal, localNormal, scaleTwo, subOne;
NRMH localNormal, localNormal;
MULH localNormal.zw, localNormal.xyxy, localNormal.xyxy;
ADDH_SAT localNormal.z, localNormal, localNormal.w;
ADDH localNormal.z, -localNormal, 1.0;
RSQH localNormal.z, localNormal.z;
RCPH localNormal.z, localNormal.z;
RFLH_SAT R3, localNormal, light;

DP3H_SAT R3.x, specular, R3;
POWH R3.x, R3.x, 8.0;
DP3H light, light, localNormal;
TXP R1, fragment.texcoord[3], texture[3], 2D;
MULH light, light, R1;
TXP R1, fragment.texcoord[2], texture[2], 2D;
MULH light, light, R1;
TEX R1, Toffset, texture[4], 2D;
MULH color.xyz, R1, program.env[0];
DP3H specular, specular, localNormal;
SUBH_SAT R1.x, specular.x, 0.75;
MULH R1.x, R1.x, R1.x;
MULH_SAT R1.x, R1.x, 16.0;
MADH R1, specular, R3.x, R1;
MADH R1, R3.x, 0.5, R1;
MULH R1, R1.x, program.env[1];
TEX R2, Soffset, texture[5], 2D;
ADDH R2, R2, R2;
MADH color.xyz, R1, R2, color;
MULH color.xyz, light, color;

MULH result.color.xyz, color, fragment.color;

END
