From 0b42d463db23d2c6eb0b6651486912ffed2f8857 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 16 Mar 2026 16:22:45 -0700 Subject: Fix normal filtering, which fixes both IBL and direct lighting flashing --- brdf.cginc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'brdf.cginc') diff --git a/brdf.cginc b/brdf.cginc index 45d350e..94e7858 100755 --- a/brdf.cginc +++ b/brdf.cginc @@ -42,7 +42,7 @@ float3 F_Schlick(float LoH, float3 f0, float f90) { // The `max(1e-4, _)` and `min(4096, _)` are hand picked to minimize the issue // of bloom making specular highlights flash as the camera moves. float D_GGX(float roughness, float NoH) { - float r2 = max(1e-4, roughness * roughness); + float r2 = roughness * roughness; float NoH2 = NoH * NoH; float NoH4 = NoH2 * NoH2; @@ -50,7 +50,8 @@ float D_GGX(float roughness, float NoH) { float r2_plus_k = r2 + k; float denom = NoH4 * r2_plus_k * r2_plus_k; - return min(4096, r2 / denom); + //return min(4096, r2 / denom); + return r2 / denom; } // Hammon "PBR Diffuse Lighting for GGX+Smith Microsurfaces" @@ -144,8 +145,6 @@ float4 brdf(Pbr pbr, LightData data, out BrdfData bd) { diffuse += direct_diffuse; } - return float4(specular + diffuse, 1); - // Indirect #if !defined(FURNACE_TEST_DIRECT) && (defined(FORWARD_BASE_PASS) || defined(OUTLINES_PASS)) { -- cgit v1.2.3