This simple toon shader was achieved with two additional features to my first URP shader:
First, I added a ramp texture and looked up the correct color multiplier on it using the pixel's attenuation value. 
Secondly, I added a custom renderer feature which is a way to script your own post-processing effect in the Unity URP.  A custom renderer feature allows you to add your own pass to the rendering pipeline. By writing a pass that applies a material to the camera output using a Blit function, you can effectively apply any post-processing effect you want. The pass that I wrote applies a sobel filter (which uses samples from the camera depth texture) to the camera render target.

You can view the full project in this repository.

Leave a comment

Log in with itch.io to leave a comment.