 		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

		{
			float lod = 0.0;

			if (u_roughness > 0.0 ||u_distribution == cLambertian)
			{
				// Mipmap Filtered Samples
				// see https://github.com/derkreature/IBLBaker

            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 * NdotH / pdf, 1.0);
            continue;
        }

