 	// relative Fresnel Factor
 	float F = getFresnelFactorAbsolute(K1, K2);
 	F = F*F;
-	float cosNumNumSamples = cos(thetaR)*dimN*dimN;
-	
+//	float cosNumNumSamples = cos(thetaR)*dimN*dimN;
+	float cosNumNumSamples = 1.0;
 	// compute G part
 	float G = pow(1 - dot(K1,K2), 2.0); 
 	

		
		float lambda_iter = iter*lambdaStep + lambda_min;
		k = (2.0*PI) / lambda_iter;
		vec2 coords = vec2((k*modUV.x/Omega) + bias, (k*modUV.y/Omega) + bias); //2d

		if(coords.x < 0.0 || coords.x > 1.0 || coords.y < 0.0 || coords.y > 1.0) continue;
		
		float w_u = k*u;
		float w_v = k*v;
		
		P = taylorApproximation(coords, k, w);
		
		float pq_scale = compute_pq_scale_factor(w_u, w_v);
		P *= pq_scale;
		
		float abs_P_Sq = P.x*P.x + P.y*P.y;
		float diffractionCoeff = 1.0;
		vec3 waveColor = avgWeighted_XYZ_weight(lambda_iter);
		brdf += vec4(diffractionCoeff * abs_P_Sq * waveColor, 1.0);	
	}

	float ambient = 0.0;	
	// remove negative values
	if(brdf.x < 0.0 ) brdf.x = 0.0;
	if(brdf.y < 0.0 ) brdf.y = 0.0;
	if(brdf.z < 0.0 ) brdf.z = 0.0;
	brdf.w = 1.0;
	
//	brdf.xyz =  brdf.xyz * gainF(_k1, _k2);
	brdf.xyz = brdf.xyz * gainF(_k1, _k2) * shadowF*1000.0;	
	brdf.xyz = getBRDF_RGB_T_D65(M_Adobe_XRNew, brdf.xyz);
	
	

		fF = fF + 4*nSkin*pow(1- cosTheta,5.0) + nK*nK;
	
	// do this division if its not on relative scale
	fF = fF / ((nSkin + 1.0)* (nSkin + 1.0) + nK*nK);
	
	return fF/R0;
}

vec3 rescaleXYZ(float X, float Y, float Z, int index){
