Outline and toon shader

I would like to create a toon shader with normal map and outline in unity using Scrumpy shader editor. I understand how to add normal map and shadow, but I don’t know how to create outline dependent on the camera view. can anybody help?

There are two main ways of doing outline shaders - the first is a per vertex calculation, and the second is a per fragment calculation.

The first requires you to create a double of the model in shaders and scale it up slightly in camera XY-plane and flatten it along the camera Z-axis.

The second requires whats called the sobel operator, or the sobel filter, which does edge detection of images. This one is a bit more expensive because it requires a second fragment pass, but after getting the image with the edges you just need to change the edge to the color you want and overlay it on the original image.

These are general ideas, but hopefully they give you some idea of how to accomplish what you want to do.