Among various different kinds of shaders, the toon shader is well known for producing cartoon-shaded scenes. The cartoon shading technique is implemented in the fragment shader. The fundamental basis of this shader is the quantization of colors. In this, a range of colors are represented by a single type of color. Mathematically, color values are constrained from a continuous set of values (in floating numbers) to a relatively small discrete color set (represented by integer values). In addition to the quantization of color, the edges of the geometry are also highlighted using the Sobel operator.
The following image shows a screenshot from the current recipe, where quantization can be easily seen in various shades of green color. In conjunction, the Sobel operator renders thick black edges: