diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-04 13:26:27 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-04 13:35:28 -0700 |
| commit | a13a00f2a28a2ea024dcc93eadd87ecf707f3ab4 (patch) | |
| tree | 4a997310fbf07d54ceeb900beba97445d9648cd5 /yum_brdf.cginc | |
| parent | b76cd52014e7f5a1b6c19a8be66d39cd28199bdc (diff) | |
fix ssao
Diffstat (limited to 'yum_brdf.cginc')
| -rw-r--r-- | yum_brdf.cginc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc index 9e44626..fde2aae 100644 --- a/yum_brdf.cginc +++ b/yum_brdf.cginc @@ -103,8 +103,8 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { const float3 energy_compensation = energyCompensation(dfg, f0);
float3 Fd = pbr.albedo / PI;
- Fd *= (1.0 - pbr.metallic) * light.attenuation;
- float3 Fr = specularLobe(pbr, f0, h, LoH, NoH, NoV, NoL_wrapped_s);
+ Fd *= (1.0 - pbr.metallic) * light.attenuation * pbr.ao;
+ float3 Fr = specularLobe(pbr, f0, h, LoH, NoH, NoV, NoL_wrapped_s) * pbr.ao;
float3 color = Fd * NoL_wrapped_d + Fr * energy_compensation * NoL_wrapped_s;
direct_standard = color * light.direct;
@@ -118,12 +118,12 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { // makers suck shit and don't use enough reflection probes.
float3 Fr = _Cloth_Sheen_Color * light.specular * light.diffuse_luminance;
float3 Fd = pbr.albedo * light.diffuse * pbr.ao;
-
+
#if defined(_MATERIAL_TYPE_CLOTH_SUBSURFACE)
// Apply subsurface color to indirect diffuse
Fd *= _Cloth_Subsurface_Color;
#endif
-
+
indirect_cloth = (Fr + Fd) * _Cloth_Indirect_Multiplier;
}
#endif
@@ -136,9 +136,9 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { const float3 E = specularDFG(dfg, f0);
const float3 energy_compensation = energyCompensation(dfg, f0);
- float3 Fr = E * light.specular * energy_compensation;
+ float3 Fr = E * light.specular * energy_compensation * pbr.ao;
float3 Fd = pbr.albedo * light.diffuse * (1.0 - E) * (1.0 - pbr.metallic) * pbr.ao;
-
+
indirect_standard = Fr + Fd;
}
|
