EDIT:
After reconsideration, just allowing us to make custom master nodes without modding the RP would probably be best. My “CustomLit” suggestion would be too limited (no control over shadows, etc…)
Toon shading is something you always see a lot people asking for when in comes to shaders, and it’s very often an issue with node-based shader tools (even UE4 has this problem)
Unfortunately it’s not possible to implement proper toon shading that supports dynamic lights using only ShaderGraph. There is a toon shading ShaderGraph sample somewhere out there, but it can only be compatible with one directional light vector, so it’s really not an interesting solution. You have no choice but to write your own custom toon MasterNodes in shader code if you want the real thing.
Doing custom lighting requires only a tiny little change in the Lighting shader code, so I was wondering if you guys could just add a “CustomLit” MasterNode that basically is the same as regular Lit but allows you to do operations on the “nDotL” value after it’s been calculated (in the case of toon lighting, we would make “nDotL” be either 0 or 1 depending on a given value threshold). Maybe also operations on final light intensity too, let’s say if someone wants their toon lighting to have no light attenuation at all
Here’s an example of my own implementation of toon shading in HDRP, which I did by adding 1 or 2 lines in the light functions of the pipeline’s shader files:
It supports all available lights and probably even GI (untested) since it’s basically the same as the default Lit shader.
I think this approach of letting users implement their own custom lighting would be much better than just shipping a pre-made “ToonLit” MasterNode that has a specific implementation, because there are many different kinds of stylized lighting (some with ramps, steps, “stylized/hand-drawn” shadow edges, etc…) and it’s better to give users the power to implement whatever they want