Toon Shader (custom Cel Shader that works in Cycles)

I created this tutorial when I realized that most people were now using the Shader-to-RGB node trick for toon shading/cel shading, which doesn’t allow for as much granular control and also doesn’t work in cycles.

This method uses a few math tricks to get around that:

(Note: Yes, I do realize this was done in an older version, but most of the techniques should apply to more recent versions as well).

BLEND file here:
toon_shader_example_file.blend (568.2 KB)

Hope this helps any passersby! Peace and God bless :v: