Toon ShadingIt is a simple and basic cartoon coloring method. Its main effect is to replace the gradient tone in normal conditions with a large block or abrupt change, so as to show the cartoon effect. With this rendering method, and then combined with the outline of the contour boundary line, this rendering method can also be very pleasing to the eye.
The main implementation method is to calculate the angle between the normal of the current pixel and the light, and then find the expected angle of the current pixel in the color table.Toon color, Use this color value to color by pixel. Of course, using the cosine value between the current normal vector and the light direction in implementation can produce the same angle effect.The color table can be determined by material or texture.ToonColor effect. The color table can also be written toProgram.
A level-4 color changeToonThe color table is as follows:
GenerateToon ShadingAs follows: