先看代码:
half4 LightingCustomLambert (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) { half NdotL = dot (s.Normal, lightDir); half4 c; c.rgb = (s.Albedo * _LightColor0.rgb * (tex2D (_RampMamp, half2 (NdotL * 0.5 + 0.5, 0)))) * (atten * 2); c.a = s.Alpha; return c; }
主要是在Properties中声明一张渐变贴图: