     _diffuse += _light.diffuse * nDotVP * attenuation;
     _specular += _light.specular * pf * attenuation;
 }
-#endif
-
-#ifdef NUM_SPOT_LIGHTS
-uniform struct SpotLight {
-	vec4 ambient;
-	vec4 diffuse;
-	vec4 specular;
+
+struct SpotLight {
+	  vec4 ambient;
+	  vec4 diffuse;
+	  vec4 specular;
    	vec4 position;
 
    	vec3 direction;
 
    	float spotExponent;
     float spotCutoff;
-	float spotCosCutoff;
+    float spotCosCutoff;
     float constantAttenuation;
     float linearAttenuation;
     float quadraticAttenuation;
-} u_spotLights[NUM_SPOT_LIGHTS];
+};
 
 void calculateSpotLight(in SpotLight _light, in vec3 _eye, in vec3 _ecPosition3, in vec3 _normal, inout vec4 _ambient, inout vec4 _diffuse, inout vec4 _specular){
     float nDotVP;           // normal . light direction

    _diffuse  += _light.diffuse * nDotVP * attenuation;
    _specular += _light.specular * pf * attenuation;
}
#endif

vec4 calculateLighting(in vec3 _ecPosition, in vec3 _normal) {


//	COMPUTE DIRECTIONAL LIGHTS
//
// #pragma tangram: DIRECTIONAL_LIGHTS
#ifdef NUM_DIRECTIONAL_LIGHTS
    calculateDirectionalLight(u_directionalLights[0], _normal, amb, diff, spec);
#endif

//	COMPUTE POINT LIGHTS
//
// #pragma tangram: POINT_LIGHTS
#ifdef NUM_POINT_LIGHTS
    calculatePointLight(u_pointLights[0], eye, _ecPosition, _normal, amb, diff, spec);
#endif

//	COMPUTE SPOT LIGHTS
//
// #pragma tangram: SPOT_LIGHTS
#ifdef NUM_SPOT_LIGHTS
    calculateSpotLight(u_spotLights[0], eye, _ecPosition, _normal, amb, diff, spec);
#endif

	vec4 color =  	amb * u_material.ambient + 
#ifdef COLOR_TEXTURE
