 #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;
-	
-
+struct gfLight{
+	int type;
+	vec4 position;
+	vec4 direction;
+	vec3 attenuation;
+	vec4 color;
+	float ambientIntensity;	//it is not used - we calculate it inside the shader
+	float intensity;
+	float beamWidth;	//it is not used - we calculate it inside the shader
+	float cutOffAngle;
+};
+
+//Generic (Scene) Uniforms
 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;
-
+
+//Material and Lighting Properties	
+uniform vec4 gfAmbientColor;
+uniform vec4 gfDiffuseColor; 
+uniform vec4 gfSpecularColor; 
+uniform vec4 gfEmissionColor;
+uniform float gfShininess;	//a.k.a. specular exponent
+uniform vec4 gfLightDiffuse;
+uniform vec4 gfLightAmbient; 
+uniform vec4 gfLightSpecular;
+
+//Fog
+uniform bool gfFogEnabled; 
+uniform vec3 gfFogColor;
+
+//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;
+
+//Texture samplers
 uniform sampler2D y_plane;
 uniform sampler2D u_plane;
 uniform sampler2D v_plane;
 
-uniform float width;
-uniform float height;
+//Texture other
 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);
 
+//Varyings
 varying vec3 n;
 varying vec4 gfEye;
 varying vec2 TexCoord;


	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);

	float half_cos = dot(normal, normalize(halfVector[i]));

	if(lights[i].type == 2){	//we have a point
		float distance = length(lightVector[i]);	
		att = 1.0 / (lights[i].attenuation.x + lights[i].attenuation.y * distance + lights[i].attenuation.z * distance * distance);

