@@ -693,11 +693,11 @@ void BSDF( float3 V, float3 L, float3 positionWS, PreLightData preLightData, BS
693693 bsdfData.roughnessB = ClampRoughnessForAnalyticalLights (bsdfData.roughnessB);
694694
695695 #ifdef LIT_USE_BSDF_PRE_LAMBDAV
696- Vis = V_SmithJointGGXAnisoLambdaV ( preLightData.TdotV, preLightData.BdotV, preLightData. NdotV, TdotL, BdotL, NdotL,
696+ Vis = V_SmithJointGGXAnisoLambdaV ( preLightData.TdotV, preLightData.BdotV, NdotV, TdotL, BdotL, NdotL,
697697 bsdfData.roughnessT, bsdfData.roughnessB, preLightData.anisoGGXLambdaV);
698698 #else
699699 // TODO: Do comparison between this correct version and the one from isotropic and see if there is any visual difference
700- Vis = V_SmithJointGGXAniso ( preLightData.TdotV, preLightData.BdotV, preLightData. NdotV, TdotL, BdotL, NdotL,
700+ Vis = V_SmithJointGGXAniso ( preLightData.TdotV, preLightData.BdotV, NdotV, TdotL, BdotL, NdotL,
701701 bsdfData.roughnessT, bsdfData.roughnessB);
702702 #endif
703703
@@ -708,18 +708,22 @@ void BSDF( float3 V, float3 L, float3 positionWS, PreLightData preLightData, BS
708708 bsdfData.roughness = ClampRoughnessForAnalyticalLights (bsdfData.roughness);
709709
710710 #ifdef LIT_USE_BSDF_PRE_LAMBDAV
711- Vis = V_SmithJointGGX (NdotL, preLightData. NdotV, bsdfData.roughness, preLightData.ggxLambdaV);
711+ Vis = V_SmithJointGGX (NdotL, NdotV, bsdfData.roughness, preLightData.ggxLambdaV);
712712 #else
713- Vis = V_SmithJointGGX (NdotL, preLightData. NdotV, bsdfData.roughness);
713+ Vis = V_SmithJointGGX (NdotL, NdotV, bsdfData.roughness);
714714 #endif
715715 D = D_GGX (NdotH, bsdfData.roughness);
716716 }
717717 specularLighting = F * (Vis * D);
718- #ifdef LIT_DIFFUSE_LAMBERT_BRDF
719- float diffuseTerm = Lambert ();
720- #else
721- float diffuseTerm = DisneyDiffuse (preLightData.NdotV, NdotL, LdotH, bsdfData.perceptualRoughness);
722- #endif
718+
719+ #ifdef LIT_DIFFUSE_LAMBERT_BRDF
720+ float diffuseTerm = Lambert ();
721+ #elif LIT_DIFFUSE_GGX_BRDF
722+ float3 diffuseTerm = DiffuseGGX (bsdfData.diffuseColor, NdotV, NdotL, NdotH, LdotV, bsdfData.perceptualRoughness);
723+ #else
724+ float diffuseTerm = DisneyDiffuse (NdotV, NdotL, LdotH, bsdfData.perceptualRoughness);
725+ #endif
726+
723727 diffuseLighting = bsdfData.diffuseColor * diffuseTerm;
724728}
725729
0 commit comments