diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-30 10:14:43 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-30 10:14:43 -0700 |
| commit | c2f86fa940195d07e2c82614985b249418f0d4f6 (patch) | |
| tree | 3a060bc60e78f49be8cc6b6b6bcc1830e5219c03 /yum_brdf.cginc | |
| parent | 4f786eba18f5535b1cba10ef0e4dc2a269dde705 (diff) | |
more brdf tweaks - mainly fix how reflectance is handled
Diffstat (limited to 'yum_brdf.cginc')
| -rw-r--r-- | yum_brdf.cginc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc index 224afc6..67c425c 100644 --- a/yum_brdf.cginc +++ b/yum_brdf.cginc @@ -119,10 +119,7 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { float3 direct_standard; { - // Fix reflectance calculation - _reflectance is already a 0-1 value, not an f0 value - // Default reflectance for dielectrics is typically 0.5, which gives f0 = 0.04 - const float dielectric_f0 = _reflectance; - // f0 = amount of light reflected back when viewing surface at a right angle + const float dielectric_f0 = computeDielectricF0(_reflectance); const float3 f0 = lerp(dielectric_f0, pbr.albedo, pbr.metallic); const float3 dfg = PrefilteredDFG_LUT(pbr.roughness_perceptual, NoV); const float3 E = specularDFG(dfg, f0); @@ -178,7 +175,6 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { float3 diffuseColor = computeDiffuseColor(pbr.albedo, pbr.metallic); float3 Fd = diffuseColor * light.diffuse * (1.0 - E) * pbr.ao; - // Apply energy compensation to indirect specular (critical fix) float3 Fr = E * light.specular * specularSingleBounceAO; indirect_standard = Fr + Fd; |
