 			if(gfNumLights>0){
 				fragColor *= vec4(rgb, alpha);
 			}else{
-				fragColor *= vec4(rgb, alpha);
+				fragColor = vec4(rgb, alpha);
 			}
 #else	//ifndef GF_GL_IS_YUV
 		if(gfNumLights>0){	//RGB texture
 			fragColor *= texture2DRect(y_plane, TexCoord);
 		}else if(gfNumLights==0){	//RGB texture with material 2D
-			fragColor *= texture2DRect(y_plane, TexCoord);
+			fragColor = texture2DRect(y_plane, TexCoord);
 		}
 #endif
 #else	//ifndef GF_GL_IS_RECT

			if(gfNumLights>0){
				fragColor *= vec4(rgb, alpha);
			}else{
				fragColor *= vec4(rgb, alpha);
			}
#else	//ifndef GF_GL_IS_YUV
		if(gfNumLights>0){	//RGB texture
			fragColor *= texture2D(y_plane, TexCoord);
		}else if(gfNumLights==0){	//RGB texture with material 2D [TODO: check]
			fragColor *= texture2D(y_plane, TexCoord);
		}
#endif
#endif
	}
	

		fragColor = fragColor * gfFogFactor + vec4(gfFogColor, zero_float) * (one_float - gfFogFactor);
	
	gl_FragColor = fragColor;
}