!!ARBfp1.0 OPTION ARB_precision_hint_fastest; OPTION ARB_fog_linear; ATTRIB dtc = fragment.texcoord[0]; ATTRIB lightdir = fragment.texcoord[1]; PARAM specfactor = 128; PARAM lightscale = program.env[2]; TEMP diffuse, light; TEX diffuse, dtc, texture[0], 2D; TEMP normal; TEX normal, dtc, texture[3], 2D; SUB normal, normal, 0.5; DP3 normal.w, normal, normal; RSQ normal.w, normal.w; MUL normal.xyz, normal.w, normal; TEMP spec, halfangle; ADD halfangle, lightdir, fragment.texcoord[2]; DP3 halfangle.w, halfangle, halfangle; RSQ halfangle.w, halfangle.w; MUL halfangle.xyz, halfangle.w, halfangle; DP3_SAT spec.x, halfangle, normal; POW spec.x, spec.x, specfactor.x; MUL spec.x, spec.x, lightscale.x; DP3_SAT light.x, normal, lightdir; MUL light.x, light.x, 1.5; MAX light.x, light.x, lightscale.y; TEMP masks; TEX masks, dtc, texture[1], 2D; MUL spec.x, spec.x, masks.r; MAD light.rgb, light.x, diffuse, spec.x; MUL light.rgb, light, fragment.color; TEMP glow; MUL glow.rgb, diffuse, lightscale.z; LRP light.rgb, masks.g, glow, light; TEMP reflect; TEMP camvec, invfresnel, rvects, rvec; DP3 camvec.w, fragment.texcoord[2], fragment.texcoord[2]; RSQ camvec.w, camvec.w; MUL camvec.xyz, camvec.w, fragment.texcoord[2]; DP3 invfresnel, camvec, normal; MUL rvects, invfresnel, normal; MAD rvects, rvects, 2, -camvec; DP3 rvec.x, rvects, fragment.texcoord[3]; DP3 rvec.y, rvects, fragment.texcoord[4]; DP3 rvec.z, rvects, fragment.texcoord[5]; MAX invfresnel, invfresnel, 0; MAD invfresnel, program.env[3].x, invfresnel, program.env[3].y; TEX reflect, rvec, texture[2], CUBE; MUL masks.b, masks.b, invfresnel; LRP result.color.rgb, masks.b, reflect, light; MUL result.color.a, diffuse.a, fragment.color.a; END