 	//#endif
 	specularTerm = max(0.0, specularTerm * nl);
 
-	//#def _SPECULARHIGHLIGHTS_OFF
+	//#def _SPECULARHIGHLIGHTS_OFF//TODO:
 		
 	vec3 color = diffColor * light.color * diffuseTerm + specularTerm * light.color * fresnelTerm(specColor, lh);
 	return vec4(color, 1.0);
 }
 
-vec4 layaBRDF1GI(vec3 diffColor, vec3 specColor, float oneMinusReflectivity,float smoothness ,float perceptualRoughness,float roughness,float nv,vec3 normal, vec3 viewDir,LayaGI gi)
+vec4 layaBRDF1GI(mediump vec3 diffColor,mediump vec3 specColor,mediump float oneMinusReflectivity,float smoothness ,float perceptualRoughness,float roughness,mediump float nv,vec3 normal, vec3 viewDir,LayaGI gi)
 {
 	// surfaceReduction = Int D(NdotH) * NdotH * Id(NdotL>0) dH = 1/(roughness^2+1)
 	float surfaceReduction;

	vec3 color =diffColor * gi.diffuse + surfaceReduction * gi.specular * fresnelLerp(specColor,vec3(grazingTerm), nv);
	return vec4(color,1.0);
}
// BRDF1-------------------------------------------------------------------------------------
{
	float t = pow5(1.0 - cosA);   // ala Schlick interpoliation
	return F0 + (vec3(1.0) - F0) * t;
}

// approximage Schlick with ^4 instead of ^5
mediump vec3 fresnelLerpFast (mediump vec3 F0, mediump vec3 F90,mediump float cosA)
{
    mediump float t = pow4 (1.0 - cosA);
    return mix (F0, F90, t);
}

float smoothnessToPerceptualRoughness(float smoothness)
