             float NdotH = clamp(dot(N, H), 0.0, 1.0);
 
             // sample lambertian at a lower resolution to avoid fireflies
-            color += vec4(textureLod(uCubeMap, H, u_lodBias).rgb, 1.0);
+            color += vec4(textureLod(uCubeMap, H, u_lodBias).rgb * NdotH / pdf, 1.0);
             continue;
         }
 

		float alpha = roughness * roughness;
		cosTheta = sqrt((1.0 - u) / (1.0 + (alpha*alpha - 1.0) * u));
		sinTheta = sqrt(1.0 - cosTheta*cosTheta);
	}
	else if(u_distribution == cCharlie)
	{

		float alpha = roughness * roughness;
		sinTheta = pow(u, alpha / (2.0*alpha + 1.0));
		cosTheta = sqrt(1.0 - sinTheta * sinTheta);
        phi = 2.0 * MATH_PI * v;
	}

    // transform the hemisphere sample to the normal coordinate frame
