float invLenLV = rsqrt(max(2.0 * LdotV + 2.0, FLT_EPS)); // invLenLV = rcp(length(L + V)) - caution about the case where V and L are opposite, it can happen, use max to avoid this
float invLenLV = rsqrt(2.0 * LdotV + 2.0); // invLenLV = rcp(length(L + V)) - caution about the case where V and L are opposite, it can happen, use max to avoid this
*/
// The abs need to happen AFTER the processing above, else value above are incorrect...
N += (2.0 * saturate(-NdotV)) * V;
NdotV = abs(dot(N, V));
float3 F = F_Schlick(bsdfData.fresnel0, LdotH);
float DV;
//float3 H = (L + V) * invLenLV;
float3 H = (L + V) * invLenLV; // <= this is not correct!
// For anisotropy we must not saturate these values
float TdotH = dot(bsdfData.tangentWS, H);
DV = DV_SmithJointGGX(NdotH, NdotL, NdotV, bsdfData.roughnessT, preLightData.partLambdaV);