|
|
|
|
|
|
float NdotV = ClampNdotV(N, V); |
|
|
|
// Optimized math. Ref: PBR Diffuse Lighting for GGX + Smith Microsurfaces (slide 114). |
|
|
|
|
|
|
|
float3 H = normalize(V + L); |
|
|
|
float NdotH = saturate(dot(N, H)); |
|
|
|
float LdotH = saturate(dot(L, H)); |
|
|
|
float LdotV = dot(L, V); |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
float3 F = F_Schlick(bsdfData.fresnel0, LdotH); |
|
|
|
float DV; |
|
|
|
|
|
|
float3 H = (L + V) * invLenLV; |
|
|
|
//float3 H = (L + V) * invLenLV; |
|
|
|
|
|
|
|
// For anisotropy we must not saturate these values |
|
|
|
float TdotH = dot(bsdfData.tangentWS, H); |
|
|
|
float TdotL = dot(bsdfData.tangentWS, L); |
|
|
|