diff options
| author | yum <yum.food.vr@gmail.com> | 2026-02-17 16:43:26 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-02-17 16:43:26 -0800 |
| commit | 3f7a950d47d64b364f1f4efea61311424d2198c4 (patch) | |
| tree | 692a89a0d56fa07555e9c9c8039391baa56e962a /yum_brdf.cginc | |
| parent | d0c27e80cefa593641f3525ef23e7fc5631b136b (diff) | |
Tweak brdf IBL
Diffstat (limited to 'yum_brdf.cginc')
| -rw-r--r-- | yum_brdf.cginc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc index a12e667..c7424d0 100644 --- a/yum_brdf.cginc +++ b/yum_brdf.cginc @@ -208,7 +208,7 @@ float4 YumBRDF(v2f i, f2f f, const YumLighting light, YumPbr pbr) { float3 indirect_standard = 0; { - float remainder = 1.0f; + float3 remainder = 1.0f; #if defined(_CLEARCOAT) && (defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS)) // Clearcoat indirect specular @@ -271,12 +271,14 @@ float4 YumBRDF(v2f i, f2f f, const YumLighting light, YumPbr pbr) { const float3 dfg = PrefilteredDFG_LUT(pbr.roughness_perceptual, NoV); const float3 E = specularDFG(dfg, f0); - const float3 energy_compensation = energyCompensation(dfg, f0); float diffuseAO = pbr.ao; float3 diffuseColor = computeDiffuseColor(pbr.albedo, pbr.metallic); - float3 Fd = diffuseColor * light.diffuse * (1.0 - E) * pbr.ao * remainder; float3 Fr = E * light.specular * remainder; + remainder = saturate(remainder - Fr); + + float3 Fd = diffuseColor * light.diffuse * pbr.ao * remainder; + indirect_standard += Fr + Fd; } |
