How can I add shadow bit depth to my toon shader?

I am jus starting out learning shader graph and want to keep things as simple as possible, it took me a few tries but I managed to make a really simple cel/toon shader.

It is missing 1 feature I really want though and I cannot figure it out, it can be seen in this video and is labeled “shadow bit depth”. Is there any way I can add that to my shade graph?

This is quite custom name, his game is pixel art, so in this context he meant that his shadow has more “bits” - colors.

In reality what he does is more like posterize node, but in general this technique is about remaping values to gradient or fixed values.

Actually he explained his own equation moment later:

thank you, I realise he explained it I just didn’t know how to translate that into shader graph language. Thanks to this I now can :slight_smile: Thank you!