 const float t_0 = dx / N_1;
 const float T_1 = t_0 * N_1;
 const float T_2 = t_0 * N_1;
-const float periods = 26.0-1.0; //26 // number of patch periods along surface
-const float Omega = ((N_1/N_2)*2.0*PI)/t_0; //(N_1/N_2)*2*PI/t_0, before 8.0*PI*pow(10.0,7.0);
+const float periods = 26.0-1.0; // 26 // number of patch periods along surface
+const float Omega = ((N_1/N_2)*2.0*PI)/t_0; // (N_1/N_2)*2*PI/t_0, before 8.0*PI*pow(10.0,7.0);
+const float bias = (N_2/2.0)/(N_2-1.0); // old: 50.0/99.0;
 
 // transformation constant
 const mat3 M_Adobe_XR = mat3(

	vec2 N_v = compute_N_min_max(v);
	vec2 N_uv[2] = vec2[2](N_u, N_v);
	
	
	// only specular contribution within epsilon range: i.e. fixed number of lambdas
	if(abs(u) < eps && abs(v) < eps){


		
	}else{
		float bias = 50.0/99.0;
		vec2 modUV = getRotation(u,v,-phi);
		
		// iterate twice: once for N_u and once for N_v lower,upper
		for(int variant = 0; variant < 2; variant++){

0.418465712421894,	-0.158660784803799,	-0.0828349276180955,
-0.0911689639090227,	0.252431442139465,	0.0157075217695576,
0.000920898625343664,	-0.00254981254686328,	0.178598913921520);


const float[16] fixed_lambdas = float[](
	390.0000,  410.6667,  431.3333,  452.0000,  
	472.6667,  493.3333,  514.0000,  534.6667,  
	555.3333,  576.0000,  596.6667,  617.3333,  
	638.0000,  658.6667,  679.3333,  700.0000
);




// FUNCTIONS

// gamma correction
vec3 getGammaCorrection(vec3 rgb, float t, float f, float s, float gamma){
