diff options
| -rw-r--r-- | brdf.cginc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -53,7 +53,7 @@ float D_GGX(float roughness, float NoH) { float r2_plus_k = r2 + k; float denom = NoH4 * r2_plus_k * r2_plus_k; - return r2 / (denom * PI); + return r2 / denom; } // Hammon "PBR Diffuse Lighting for GGX+Smith Microsurfaces" @@ -185,6 +185,7 @@ float4 brdf(Pbr pbr, LightData data) { float DFGcc = Fcc * Dcc * Gcc; float3 direct_specular_cc = DFGcc * data.direct.color * data.direct.NoL_cc * pbr.cc_strength; direct_specular_cc *= cc_energy_comp; + direct_specular_cc *= layer_attenuation; direct_specular_cc = max(0, direct_specular_cc); specular += direct_specular_cc; layer_attenuation *= saturate(1.0f - Fcc * pbr.cc_strength); @@ -209,7 +210,6 @@ float4 brdf(Pbr pbr, LightData data) { direct_specular *= data.direct.color * data.direct.NoL; direct_specular *= energy_comp; direct_specular *= layer_attenuation; - direct_specular *= PI; direct_specular = max(0, direct_specular); specular += direct_specular; |
