diff options
| author | yum <yum.food.vr@gmail.com> | 2024-10-05 17:32:47 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-10-05 17:32:47 -0700 |
| commit | 144d7bc5cc999b9c5f84a9a7fc2a86dafe276df1 (patch) | |
| tree | f258bc63750ed35720110edc457a1703763daf5d /MochieStandardBRDF.cginc | |
| parent | 54cf2749759045b646282c5e28139510d3e7783e (diff) | |
Fix SSR
Diffstat (limited to 'MochieStandardBRDF.cginc')
| -rw-r--r-- | MochieStandardBRDF.cginc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MochieStandardBRDF.cginc b/MochieStandardBRDF.cginc index 1bf85c6..fbf6b66 100644 --- a/MochieStandardBRDF.cginc +++ b/MochieStandardBRDF.cginc @@ -86,7 +86,7 @@ half4 BRDF1_Mochie_PBS ( half3 diffColor, half3 specColor, half oneMinusReflectivity, half smoothness, half3 normal, half3 viewDir, half3 worldPos, half2 screenUVs, half4 screenPos, half metallic, half thickness, half3 ssColor, half atten, float2 lightmapUV, float3 vertexColor, - UnityLight light, UnityIndirect gi, float reflection_strength) + UnityLight light, UnityIndirect gi, float reflection_strength, float ssr_mask) { half perceptualRoughness = SmoothnessToPerceptualRoughness(smoothness); @@ -144,8 +144,8 @@ half4 BRDF1_Mochie_PBS ( ssrCol.rgb *= _SSRStrength; if (_EdgeFade == 0) ssrCol.a = ssrCol.a > 0 ? 1 : 0; - reflCol = lerp(reflCol, ssrCol.rgb, ssrCol.a * saturate(_SSRStrength)); - specCol *= 1-ssrCol.a; + reflCol = lerp(reflCol, ssrCol.rgb, ssrCol.a * saturate(_SSRStrength * ssr_mask)); + specCol *= 1 - ssrCol.a * ssr_mask; #endif half3 subsurfaceCol = 0; |
