Cell shading without post processing or forward rendering

The idea comes from this great tutorial about a cel shading material (but with a single and explicit light vector to fake a directional light)
https://www.youtube.com/watch?v=9YQEAvvzh0k&t=1153s
Basically he uses a grayscale gradient as UV for the ramp texture, so I did the same thing to round the normal values: each channel value of the normal vector becomes one UV coordinate for the ramp.
I’ll try a guide :
40e410f8f4c648d1198509e6cea4aa795d1f171c.jpeg
Painting different areas in the ramp textures allows you to choose how to round the normals. So, instead of dividing the normal into 2, 3 or more equal steps you can adjust the ratio between dark and light areas and have smoothed transitions.
So a value for the normal of (for example) 0,27 as UV corresponds to, let’s say, a black color from the ramp (or 0)… or it could be 0,25 if you paint more gray bands instead of simply half black and half white.
Hope I was clear… sometimes I find quite hard to explain what I’m doing :slight_smile: