 vec3 filterColor(vec3 N)
 {
     //return  textureLod(uCubeMap, N, 3.0).rgb;
-    vec4 color = vec4(0.f);
+    vec3 color = vec3(0.f);
 
     for(int i = 0; i < u_sampleCount; ++i)
     {

                    // without this the roughness=0 lod is too high (taken from original implementation)
                    lod = u_lodBias;
                }

                color += vec4(textureLod(uCubeMap, L, lod).rgb * NdotL, NdotL);
            }
        }
    }

    if(color.w == 0.f)
    {
        return color.rgb;
    }

    return color.rgb / color.w;
}

// From the filament docs. Geometric Shadowing function


        if(u_distribution == cLambertian)
        {
            // sample lambertian at a lower resolution to avoid fireflies
            vec3 lambertian = textureLod(uCubeMap, H, lod).rgb;

