I have successfully created a highly customizable Cel/Toon shader for Blender Eevee. The shader has lots of features, including but not limited to: Multiple light sources support, tone shape manipulation, various specular options, rimlightning or hatching.
One of the most important features (which I did not realize up until now) is that the shader reacts on shadows. One monkey head casts shadow on the other.
I would like to recreate this shader in Cycles with all of it's features. However I hit a brick wall right at the start. Using the Toon BSDF within Cycles is a simple enough solution, but I could not figure out how to include features like hatching in the shadows or tone shape change.
I believe creating a custom cel shader is the only option to get the similar effects. So I made the basic dot product between an incoming light vector and surface normal. Unfortunately, this shader no longer respects the shadows generated by other objects (no shadows on the lower monkey head). Also, the shader does not really respects the incoming light, but rather only the position of the light object. The light source could be replaced by an empty object which produces the same result.
I have scouted lots of websites and tested lots of alternatives to this node setup, but I could not get the shadows to show up. The only solution that worked for me is this old thread, with a link to OSL shader. While the shader does generate shadows, I don't know OSL, therefore I can't really customize the code.
Is there really a way to make a true toon shader material in Cycles?
So I guess my questions for today are:
- How to make a Cycles Cel/Toon shader, that generates shadows on other objects, without using Toon BSDF?
- How to make the Cycles Cel/Toon shader respect the incoming light? (it's direction, color and strenght)
- Are there any other difficulties in making the customizable Cel/Toon shader that I might run into?