diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-30 20:37:47 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-30 20:37:47 -0700 |
| commit | 33a4a6d93f5f6c98cfc1bda95f9d3903310bc511 (patch) | |
| tree | 5c99afc2344ff09c9c68b20dac18a74e332d0a0f /yum_brdf.cginc | |
| parent | 586f15513edd509f6ea7258eca52c1038024ac07 (diff) | |
add wrapped spherical harmonics
Diffstat (limited to 'yum_brdf.cginc')
| -rw-r--r-- | yum_brdf.cginc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc index 364a183..daa6793 100644 --- a/yum_brdf.cginc +++ b/yum_brdf.cginc @@ -99,10 +99,9 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { #if defined(_MATERIAL_TYPE_CLOTH_SUBSURFACE) // Energy conservative wrap diffuse for subsurface scattering - float wrap_diffuse = saturate((NoL + 0.5) / 2.25); - Fd *= wrap_diffuse; + Fd *= NoL_wrapped_d; // Apply subsurface color - Fd *= saturate(_Cloth_Subsurface_Color + NoL); + Fd *= saturate(_Cloth_Subsurface_Color + NoL_wrapped_d); #endif // Cloth specular BRDF - multiply by PI to match Unity intensities @@ -110,9 +109,9 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) { #if defined(_MATERIAL_TYPE_CLOTH_SUBSURFACE) // No need to multiply by NoL when using subsurface scattering - direct_cloth = (Fd + Fr * NoL) * light.direct * _Cloth_Direct_Multiplier; + direct_cloth = (Fd + Fr * NoL_wrapped_s) * light.direct * _Cloth_Direct_Multiplier; #else - direct_cloth = (Fd + Fr) * NoL * light.direct * _Cloth_Direct_Multiplier; + direct_cloth = (Fd + Fr) * NoL_wrapped_d * light.direct * _Cloth_Direct_Multiplier; #endif } #endif |
