summaryrefslogtreecommitdiffstats
path: root/yum_brdf.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-06-15 15:03:22 -0700
committeryum <yum.food.vr@gmail.com>2025-06-15 15:03:22 -0700
commit478cb4e07622488915132c8de2f52dc5c19bb6c0 (patch)
treeb2f88ee10edc9c983fc2ea30ed9e16bdd38c9737 /yum_brdf.cginc
parentb57eb0894b8abef05db7648addf089cdd3773b54 (diff)
Touch up shadows
Diffstat (limited to 'yum_brdf.cginc')
-rw-r--r--yum_brdf.cginc6
1 files changed, 3 insertions, 3 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc
index 6a4b5e5..cd97865 100644
--- a/yum_brdf.cginc
+++ b/yum_brdf.cginc
@@ -91,7 +91,7 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) {
#endif
// Cloth specular BRDF
- float3 Fr = specularLobe(pbr, 0.04, h, LoH, NoH, NoV, NoL_wrapped_s);
+ float3 Fr = specularLobe(pbr, 0.04, h, LoH, NoH, NoV, NoL_wrapped_s) * light.attenuation;
#if defined(_MATERIAL_TYPE_CLOTH_SUBSURFACE)
// No need to multiply by NoL when using subsurface scattering
@@ -117,7 +117,7 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) {
float3 Fd = pbr.albedo / PI;
Fd *= (1.0 - pbr.metallic) * light.attenuation * pbr.ao;
- float3 Fr = specularLobe(pbr, f0, h, LoH, NoH, NoV, NoL_wrapped_s) * pbr.ao * PI;
+ float3 Fr = specularLobe(pbr, f0, h, LoH, NoH, NoV, NoL_wrapped_s) * pbr.ao * PI * light.attenuation;
float3 color = Fd * NoL_wrapped_d + Fr * energy_compensation * NoL_wrapped_s;
direct_standard = color * light.direct;
@@ -154,7 +154,7 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) {
float specularAO = computeSpecularAO(NoV, diffuseAO * light.occlusion, pbr.roughness);
float3 specularSingleBounceAO = singleBounceAO(specularAO) * energy_compensation;
- float3 Fd = pbr.albedo * light.diffuse * (1.0 - E) * (1.0 - pbr.metallic) * pbr.ao * light.attenuation;
+ float3 Fd = pbr.albedo * light.diffuse * (1.0 - E) * (1.0 - pbr.metallic) * pbr.ao;
float3 Fr = E * light.specular * specularSingleBounceAO;
indirect_standard = Fr + Fd;