|
|
|
|
|
|
bsdfData.roughnessB = ClampRoughnessForAnalyticalLights(bsdfData.roughnessB); |
|
|
|
|
|
|
|
#ifdef LIT_USE_BSDF_PRE_LAMBDAV |
|
|
|
Vis = V_SmithJointGGXAnisoLambdaV( preLightData.TdotV, preLightData.BdotV, preLightData.NdotV, TdotL, BdotL, NdotL, |
|
|
|
Vis = V_SmithJointGGXAnisoLambdaV( preLightData.TdotV, preLightData.BdotV, NdotV, TdotL, BdotL, NdotL, |
|
|
|
Vis = V_SmithJointGGXAniso( preLightData.TdotV, preLightData.BdotV, preLightData.NdotV, TdotL, BdotL, NdotL, |
|
|
|
Vis = V_SmithJointGGXAniso( preLightData.TdotV, preLightData.BdotV, NdotV, TdotL, BdotL, NdotL, |
|
|
|
bsdfData.roughnessT, bsdfData.roughnessB); |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
bsdfData.roughness = ClampRoughnessForAnalyticalLights(bsdfData.roughness); |
|
|
|
|
|
|
|
#ifdef LIT_USE_BSDF_PRE_LAMBDAV |
|
|
|
Vis = V_SmithJointGGX(NdotL, preLightData.NdotV, bsdfData.roughness, preLightData.ggxLambdaV); |
|
|
|
Vis = V_SmithJointGGX(NdotL, NdotV, bsdfData.roughness, preLightData.ggxLambdaV); |
|
|
|
Vis = V_SmithJointGGX(NdotL, preLightData.NdotV, bsdfData.roughness); |
|
|
|
Vis = V_SmithJointGGX(NdotL, NdotV, bsdfData.roughness); |
|
|
|
#ifdef LIT_DIFFUSE_LAMBERT_BRDF |
|
|
|
float diffuseTerm = Lambert(); |
|
|
|
#else |
|
|
|
float diffuseTerm = DisneyDiffuse(preLightData.NdotV, NdotL, LdotH, bsdfData.perceptualRoughness); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef LIT_DIFFUSE_LAMBERT_BRDF |
|
|
|
float diffuseTerm = Lambert(); |
|
|
|
#elif LIT_DIFFUSE_GGX_BRDF |
|
|
|
float3 diffuseTerm = DiffuseGGX(bsdfData.diffuseColor, NdotV, NdotL, NdotH, LdotV, bsdfData.perceptualRoughness); |
|
|
|
#else |
|
|
|
float diffuseTerm = DisneyDiffuse(NdotV, NdotL, LdotH, bsdfData.perceptualRoughness); |
|
|
|
#endif |
|
|
|
|
|
|
|
diffuseLighting = bsdfData.diffuseColor * diffuseTerm; |
|
|
|
} |
|
|
|
|
|
|
|