 		
 	vec3 totalXYZ = cdiff.xyz/10.0 + eps;
 	vec3 pepepe = totalXYZ;
-	float value = (getShadowMaskFactor(k1, k2)*gainF(k1, k2));
+	float value = (getShadowMaskFactor(k1, k2)*gainFactor(k1, k2));
 	value = (value < 0.0) ? 0.0 : value;
 	vec3 pewpew = 1.0*totalXYZ*value;
 	frag_shaded = anis*vec4(gammaCorrect(pewpew, 2.6), 1.0);
 }
 
+// non-uniform wavelength spectrum sampling along a certain direction
+// @param bounderies integration range [N_min, N_max]
+// @param dir direction along we perform the sampling (either u or v)
+// @param spacing periodicity constant
+// @returns XIE XYZ color contribution along a certain direction.
 vec3 sumContributionAlongDir(vec2 boundaries, float dir, float spacing) {
 	float f = 4;
 	float lambda_min = 0.38; // 400nm red

// compute n_min n_max from given direction
// spacing in microns
// t is absolute valued compontent of (u,v,w)
vec2 getNMMfor(float t, float spacing) {
	float lambda_min = 0.38; // 400nm red
	float lambda_max = 0.78; // 700nm blue

	return output;
}

//compute fresnel coefficient according to Schlick's approximation
//quantitative description of transmissed and reflectied fraction of light
//when a beam of light hits a plane surface.
//describe what fraction of the light is reflected and what fraction is refracted
//see: http://en.wikipedia.org/wiki/Fresnel_equations
//@param K1 incident light direction
//@param K2 viewing direction
//@return reflected amount of light
float getFresnelFactor(vec3 K1, vec3 K2){
	float nSkin = 1.5;
	float nK = 0.0;
