I’m using the WrapLambert lighting model in one of my shaders. Does anyone know if its possibly to change the values in it as the distance away from an object changes? Here’s what I’m working with :
half4 LightingWrapLambert (SurfaceOutput s, half3 lightDir, half atten) {
half NdotL = dot (s.Normal, lightDir);
half diff = NdotL * .5 + .25;
half4 c;
c.rgb = s.Albedo * _LightColor0.rgb * (diff * atten * 2);
c.a = s.Alpha;
return c;
}
I want it to change from half diff = NdotL * .5 + .25; when far away from an object to half diff = NdotL * .5 + .8; when close.