From 92c6798e701299154f382aeb2262e81928a2fb13 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 11 Nov 2025 21:30:08 -0800 Subject: brdf simplifications --- brdf.cginc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brdf.cginc b/brdf.cginc index 8714181..682f6a0 100644 --- a/brdf.cginc +++ b/brdf.cginc @@ -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; -- cgit v1.2.3