 
 vec3 uvToXYZ(int face, vec2 uv)
 {
-	if(face == 0)
-		return vec3(     1.f,   uv.y,    -uv.x);
-
-	else if(face == 1)
-		return vec3(    -1.f,   uv.y,     uv.x);
-
-	else if(face == 2)
-		return vec3(   +uv.x,   -1.f,    +uv.y);
-
-	else if(face == 3)
-		return vec3(   +uv.x,    1.f,    -uv.y);
-
-	else if(face == 4)
-		return vec3(   +uv.x,   uv.y,      1.f);
-
-	else {//if(face == 5)
-		return vec3(    -uv.x,  +uv.y,     -1.f);}
+    if(face == 0)
+        return vec3(     1.f,   uv.y,    -uv.x);
+
+    else if(face == 1)
+        return vec3(    -1.f,   uv.y,     uv.x);
+
+    else if(face == 2)
+        return vec3(   +uv.x,   -1.f,    +uv.y);
+
+    else if(face == 3)
+        return vec3(   +uv.x,    1.f,    -uv.y);
+
+    else if(face == 4)
+        return vec3(   +uv.x,   uv.y,      1.f);
+
+    else {//if(face == 5)
+        return vec3(    -uv.x,  +uv.y,     -1.f);}
 }
 
 vec2 dirToUV(vec3 dir)
 {
-	return vec2(
-		0.5f + 0.5f * atan(dir.z, dir.x) / MATH_PI,
-		1.f - acos(dir.y) / MATH_PI);
+    return vec2(
+            0.5f + 0.5f * atan(dir.z, dir.x) / MATH_PI,
+            1.f - acos(dir.y) / MATH_PI);
 }
 
 float saturate(float v)
 {
-	return clamp(v, 0.0f, 1.0f);
+    return clamp(v, 0.0f, 1.0f);
 }
 
 // Hammersley Points on the Hemisphere


vec3 filterColor(vec3 N)
{
	//return  textureLod(uCubeMap, N, 3.0).rgb;
	vec4 color = vec4(0.f);

	for(int i = 0; i < u_sampleCount; ++i)
	{
        vec4 importanceSample = getImportanceSample(i, N, u_roughness);

		vec3 H = vec3(importanceSample.xyz);
        float pdf = importanceSample.w;

        // mipmap filtered samples (GPU Gems 3, 20.4)

            continue;
        }

        // Note: reflect takes incident vector.
        vec3 V = N;
        vec3 L = normalize(reflect(-V, H));
        float NdotL = dot(N, L);

        if (NdotL > 0.0)
        {
            if(u_roughness == 0.0)
            {
                // without this the roughness=0 lod is too high (taken from original implementation)
