summaryrefslogtreecommitdiffstats
path: root/ssfd.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'ssfd.cginc')
-rw-r--r--ssfd.cginc5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssfd.cginc b/ssfd.cginc
index 5d385c6..c3e1c89 100644
--- a/ssfd.cginc
+++ b/ssfd.cginc
@@ -59,10 +59,11 @@ void apply_ssfd(v2f i, float2 uv, LightData l, float3 normal, inout float3 albed
float ssfd_mask = ssfd(uv, _SSFD_Scale, _SSFD_Max_Fwidth, 0, _SSFD_Noise);
float ssfd_mask_fw = fwidth(ssfd_mask);
// TODO I think anti aliasing is probably broken
- float light_amount = 1.0 - (dot(l.indirect.diffuse_dominant_dir, normal) * 0.5 + 0.5);
+ //float light_amount = 1.0 - (dot(l.indirect.diffuse_dominant_dir, normal) * 0.5 + 0.5);
+ float light_amount = 0;
float ssfd_threshold = saturate(light_amount + _SSFD_Threshold);
ssfd_mask = smoothstep(ssfd_threshold - ssfd_mask_fw * 0.5, ssfd_threshold + ssfd_mask_fw * 0.5, ssfd_mask);
- albedo += ssfd_mask * _SSFD_Tint.rgb;
+ albedo = lerp(albedo, _SSFD_Tint.rgb, ssfd_mask);
#endif
}