I’m trying to make a cel shader, but it ends up looking like this:
See those weird lines? It’s like there’s an extra form of shading that’s bugging out and producing lines.
I was following this tutorial:
I am using forward rendering so I copied his shader and modified it to have three cuts and not be so bright.
Relevant code:
half4 LightingCelShadingForward(SurfaceOutput s, half3 lightDir, half atten)
{
half NdotL = dot(s.Normal, lightDir);
if (NdotL < -0.6) NdotL = 0;
else if (NdotL >= -0.6 && NdotL < 0.3) NdotL = 0.2;
else NdotL = 0.4;
half4 c;
c.rgb = s.Albedo * _LightColor0.rgb * (NdotL * atten * 2);
c.a = s.Alpha;
return c;
}
Thank you.