"// ambient+diffuse+specular+normalmap+attenuation+cubemap+fog shader\n"
"// written by Forest 'LordHavoc' Hale\n"
"\n"
+"// use half floats if available for math performance\n"
+"#ifdef GEFORCEFX\n"
+"#define myhalf half\n"
+"#define myhvec2 hvec2\n"
+"#define myhvec3 hvec3\n"
+"#define myhvec4 hvec4\n"
+"#else\n"
+"#define myhalf float\n"
+"#define myhvec2 vec2\n"
+"#define myhvec3 vec3\n"
+"#define myhvec4 vec4\n"
+"#endif\n"
+"\n"
"uniform vec3 LightPosition;\n"
"\n"
"varying vec2 TexCoord;\n"
-"varying vec3 CubeVector;\n"
-"varying vec3 LightVector;\n"
+"varying myhvec3 CubeVector;\n"
+"varying myhvec3 LightVector;\n"
"\n"
"#if defined(USESPECULAR) || defined(USEFOG) || defined(USEOFFSETMAPPING)\n"
"uniform vec3 EyePosition;\n"
-"varying vec3 EyeVector;\n"
+"varying myhvec3 EyeVector;\n"
"#endif\n"
"\n"
"// TODO: get rid of tangentt (texcoord2) and use a crossproduct to regenerate it from tangents (texcoord1) and normal (texcoord3)\n"
"#endif\n"
"\n"
"varying vec2 TexCoord;\n"
-"varying vec3 CubeVector;\n"
-"varying vec3 LightVector;\n"
+"varying myhvec3 CubeVector;\n"
+"varying myhvec3 LightVector;\n"
"#if defined(USESPECULAR) || defined(USEFOG) || defined(USEOFFSETMAPPING)\n"
-"varying vec3 EyeVector;\n"
+"varying myhvec3 EyeVector;\n"
"#endif\n"
"\n"
"void main(void)\n"
" myhvec3 color = myhvec3(texture2D(Texture_Color, TexCoord)) * (AmbientScale + DiffuseScale * max(dot(surfacenormal, diffusenormal), 0.0));\n"
"#ifdef USESPECULAR\n"
" myhvec3 specularnormal = myhvec3(normalize(diffusenormal + myhvec3(normalize(EyeVector))));\n"
-" color += myhvec3(texture2D(Texture_Gloss, TexCoord)) * (SpecularScale * pow(max(dot(surfacenormal, specularnormal), 0.0), SpecularPower));\n"
+" color += myhvec3(texture2D(Texture_Gloss, TexCoord)) * SpecularScale * pow(max(dot(surfacenormal, specularnormal), 0.0), SpecularPower);\n"
"#endif\n"
"\n"
"#ifdef USECUBEFILTER\n"