Cell shading without post processing or forward rendering

Can you explain a little more about how your ramp texture works? I’m struggling to understand and recreate your results here.