 		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

    mat3 TBN = generateTBN(N);
    vec3 direction = TBN * localSpaceDirection;

    float pdf = PDF(direction, N, roughness);

    return vec4(direction, pdf);
}

            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;
        }

