         i = i / (0.1 + nv);
         specfac = i;
     }
-    return specfac;
-}
-
-void lambert(const in float ndl, const in vec3 diffuse, out vec3 diffuseContrib)
-{
-    diffuseContrib = ndl*diffuse;
+    specularContrib = specfac*materialSpecular*lightSpecular;
+}
+
+void lambert(const in float ndl,  const in vec3 materialDiffuse, const in vec3 lightDiffuse, out vec3 diffuseContrib)
+{
+    diffuseContrib = ndl*materialDiffuse*lightDiffuse;
 }
 /////////
 /// UTILS

    const in vec3 normal,
    const in vec3 eyeVector,

    //const in vec4 u_materialAmbient,
    //const in vec4 u_materialDiffuse,
    //const in vec4 u_materialSpecular,
    //const in float u_materialShininess,

    const in vec4 lightAmbient,
    const in vec4 lightDiffuse,

        {
          bool isShadowed = false;
          // compute shadowing term here.
          float shadowContrib = 1.0;
          // isShadowed = computeShadow(shadowContrib)
          if (!isShadowed){
            vec3 diffuseContrib;
            lambert(NdotL, Material_uniform_diffuse.rgb, lightDiffuse.rgb, diffuseContrib);
            vec3 specularContrib;
            specularCookTorrance(normal, lightDirection, eyeVector, Material_uniform_shininess, Material_uniform_specular.rgb, lightSpecular.rgb, specularContrib.rgb);
            return vec4(lightAmbient.rgb*Material_uniform_ambient.rgb + attenuation*spotblend*diffuseContrib.rgb*specularContrib.rgb*shadowContrib, 1.0);
          }
        }
    }
