A character focused Toon Shader for Unity using Shader Graph. Using a C# helper script on the object to supply lighting data to the material, making it flexible and programmable. While it's not the most optimised and ideal approach for every scenario, it's a different take on toon shading and passing lighting data.
Improvements, forks and pull requests are welcome. Be sure to check out the tutorial to follow the process of building this shader from scratch.
How to build this shader from scratch:
AwesomeToonHelper
script to your character (On the Game object with the Mesh renderer)AwesomeToon
shader, and set this as the SourceMaterial
input on the Awesome Toon Helper
component.Shading Gradient
to one of the gradients in this repo, or make your own.By default the script will take a copy of your material and apply it to the model. Any changes to this copy (instance) will not be retained, this allows many characters to share the same source material and have individual lighting data. If you are making changes to the source material, uncheck instance material
temporarily.
If the Awesome Toon Sub
node is not found in the Awesome Toon
shader, delete it and add it back in again, then save.
Depending on the lighting setup of your scene, you might have to delete the "Baked GI" node for things to look right.
Raycasts need a mask to work, set it to Default
and add other relevant layers to the mark for it to detect if light sources are obstructed.