Toon sobel outlines using depth + view normals, and distance based parameters. (URP)
toon shading in the image below by cyanilux, not included
Download the unity package from Releases.
Add Full Screen Pass Renderer Feature to your Universal Renderer Data.
Requirements must have Depth and Normal enabled.
Set the material to the Outlines material with the outlines shader.
IMPORTANT: when testing with scene view camera, make sure the near and far values in the scene camera settings are the same as your game's camera.
Scale - the distance of the pixel sampling. Values other than 1 may introduce visual artifacts.
NearNormalThreshold - the normal threshold when the camera is at 0 distance.
FarNormalThreshold - the normal threshold when the camera is at MaxFadeDistance distance.
NearDepthThreshold - the depth threshold when '''.
FarDepthThreshold - the depth threshold when '''.
MinFadeDistance - the minimum distance for the fade to begin.
MaxFadeDistance - the maximum distance for the outline to be visible. pixels farther than MaxFadeDistance will not be sampled.
Angle - A viewing angle for multiplying the depth outline to avoid artifacts when the viewing angle is nearly perpendicular.
AngleMultiplier - When reaching Angle, depth outline will be multiplied by this value.


