 
 	vec4 lightColor = vec4(zero_float, zero_float, zero_float, zero_float);
 	float att = zero_float;
+
 	vec3 lightVnorm = normalize(lightVector[i]);
 	vec3 normal = normalize(n);
+
 	if(gfLightTwoSide && (!gl_FrontFacing)){//light back face
 		//originally: normal *=-1; -> Not compliant with Shading Language v1.0
 		normal *= vec3(-1.0, -1.0, -1.0);

#define CLIPS_MAX 		8

//Light Structure
	struct gfLight{
		int type;
		vec4 position;
		vec4 direction;
		vec3 attenuation;
		vec4 color;
		float ambientIntensity;
		float intensity;
		float beamWidth;
		float cutOffAngle;
	};

//Fog
	uniform bool gfFogEnabled; 
	uniform vec3 gfFogColor;

//Material Properties	
	uniform vec4 gfAmbientColor;
	uniform vec4 gfDiffuseColor; 
	uniform vec4 gfSpecularColor; 
	uniform vec4 gfEmissionColor;
	uniform float gfShininess;

//Color Matrix
	uniform mat4 gfColorMatrix;
	uniform bool hasColorMatrix;
	uniform vec4 gfTranslationVector;
	
//Color Key
	uniform vec3 gfKeyColor;
	uniform float gfKeyAlpha;
	uniform float gfKeyLow;
	uniform float gfKeyHigh;
	uniform bool hasColorKey;
	

uniform int gfNumLights;
uniform bool gfLightTwoSide;
uniform vec4 gfLightPosition; 
uniform vec4 gfLightDiffuse;
uniform vec4 gfLightAmbient; 
uniform vec4 gfLightSpecular;
uniform int gfNumTextures;
uniform gfLight lights[LIGHTS_MAX];
uniform bool hasClip;
uniform bool hasMeshColor;
uniform bool enableLights;

uniform sampler2D y_plane;
uniform sampler2D u_plane;
uniform sampler2D v_plane;

uniform float width;
uniform float height;
uniform float alpha;
const vec3 offset = vec3(-0.0625, -0.5, -0.5);
const vec3 R_mul = vec3(1.164,  0.000,  1.596);
const vec3 G_mul = vec3(1.164, -0.391, -0.813);
const vec3 B_mul = vec3(1.164,  2.018,  0.000);

varying vec3 n;
varying vec4 gfEye;
varying vec2 TexCoord;

varying float gfFogFactor;

//testing material
varying vec4 m_color;

//constants
const float zero_float = 0.0;
const float one_float = 1.0;

