"#ifdef MODE_LIGHTSOURCE\n"
"varying vec3 LightVector;\n"
"#endif\n"
-"#if defined(MODE_LIGHTDIRECTION)\n"
+"#if defined(MODE_LIGHTDIRECTION) && defined(USEDIFFUSE)\n"
"varying vec3 LightVector;\n"
"#endif\n"
"\n"
"\n"
"# ifdef USECUBEFILTER\n"
" vec3 cubecolor = textureCube(Texture_Cube, CubeVector).rgb;\n"
-" gl_FragData[0] *= cubecolor;\n"
-" gl_FragData[1] *= cubecolor;\n"
+" gl_FragData[0].rgb *= cubecolor;\n"
+" gl_FragData[1].rgb *= cubecolor;\n"
"# endif\n"
"}\n"
"#endif // FRAGMENT_SHADER\n"
"\n"
"#ifdef MODE_LIGHTDIRECTION\n"
"#define SHADING\n"
+"#ifdef USEDIFFUSE\n"
" myhalf3 lightnormal = myhalf3(normalize(LightVector));\n"
+"#endif\n"
"#define lightcolor LightColor\n"
"#endif // MODE_LIGHTDIRECTION\n"
"#ifdef MODE_LIGHTDIRECTIONMAP_MODELSPACE\n"
"\n"
"#ifdef MODE_LIGHTDIRECTION\n"
"#define SHADING\n"
+"#ifdef USEDIFFUSE
" half3 lightnormal = half3(normalize(LightVector));\n"
+"#endif\n"
"#define lightcolor LightColor\n"
"#endif // MODE_LIGHTDIRECTION\n"
"#ifdef MODE_LIGHTDIRECTIONMAP_MODELSPACE\n"