diff options
| author | yum <yum.food.vr@gmail.com> | 2025-11-11 21:30:08 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-11-11 21:30:08 -0800 |
| commit | 92c6798e701299154f382aeb2262e81928a2fb13 (patch) | |
| tree | c91ce3324074791e73fd68902d539608c9f4caad /brdf.cginc | |
| parent | efb0ebd7ba8cb78f4b5059147bfd7e1885968bf6 (diff) | |
brdf simplifications
Diffstat (limited to 'brdf.cginc')
| -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; |
