|
|
|
|
|
|
return INV_PI; |
|
|
|
} |
|
|
|
|
|
|
|
float DisneyDiffuseNoPI(float NdotV, float NdotL, float LdotH, float perceptualRoughness) |
|
|
|
float DisneyDiffuseNoPI(float NdotV, float NdotL, float LdotV, float perceptualRoughness) |
|
|
|
float fd90 = 0.5 + 2 * LdotH * LdotH * perceptualRoughness; |
|
|
|
// (2 * LdotH * LdotH) = 1 + LdotV |
|
|
|
// float fd90 = 0.5 + 2 * LdotH * LdotH * perceptualRoughness; |
|
|
|
float fd90 = 0.5 + (perceptualRoughness + perceptualRoughness * LdotV); |
|
|
|
float viewScatter = F_Schlick(1.0, fd90, NdotV); |
|
|
|
float viewScatter = F_Schlick(1.0, fd90, NdotV); |
|
|
|
float DisneyDiffuse(float NdotV, float NdotL, float LdotH, float perceptualRoughness) |
|
|
|
float DisneyDiffuse(float NdotV, float NdotL, float LdotV, float perceptualRoughness) |
|
|
|
return INV_PI * DisneyDiffuseNoPI(NdotV, NdotL, LdotH, perceptualRoughness); |
|
|
|
return INV_PI * DisneyDiffuseNoPI(NdotV, NdotL, LdotV, perceptualRoughness); |
|
|
|
float facing = 0.5 + 0.5 * LdotV; |
|
|
|
float facing = 0.5 + 0.5 * LdotV; // (LdotH)^2 |
|
|
|
// This constant is picked s.t. setting perceptualRoughness, albedo and all angles to 1 |
|
|
|
// This constant is picked s.t. setting perceptualRoughness, albedo and all cosines to 1 |
|
|
|
// allows us to match the Lambertian and the Disney Diffuse models. Original value: 0.1159. |
|
|
|
float multiple = perceptualRoughness * (0.079577 * PI); // Rescaled by PI |
|
|
|
|
|
|
|