diff options
| author | yum <yum.food.vr@gmail.com> | 2026-03-16 16:22:45 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-03-16 16:22:45 -0700 |
| commit | 0b42d463db23d2c6eb0b6651486912ffed2f8857 (patch) | |
| tree | 20fc0398a794429146b7875ae6f655b01ab414de /brdf.cginc | |
| parent | 1a35d85c623569dd2e61b821bfe3a7f03f99343f (diff) | |
Fix normal filtering, which fixes both IBL and direct lighting flashing
Diffstat (limited to 'brdf.cginc')
| -rwxr-xr-x | brdf.cginc | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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)) { |
