 
         if(u_distribution == cLambertian)
         {
-            float NdotH = clamp(dot(N, H), 0.0, 1.0);
-
             // sample lambertian at a lower resolution to avoid fireflies
             vec3 lambertian = textureLod(uCubeMap, H, lod).rgb;
 

                    // 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

            // lambertian /= pdf; // invert bias from importance sampling
            // lambertian /= MATH_PI; // convert irradiance to radiance https://seblagarde.wordpress.com/2012/01/08/pi-or-not-to-pi-in-game-lighting-equation/

            color += lambertian;
        }
        else if(u_distribution == cGGX || u_distribution == cCharlie)
        {
