Non photorealistic lighting model

A Non-Photorealistic Lighting Model For Automatic Technical Illustration

Proceedings of the 25th annual conference on Computer graphics and interactive techniques – SIGGRAPH ’98

introduce

One of the things about stylizing renders is that you don’t have to worry about physics, just how good it looks. This paper is a classic stylized rendering paper, which provides a cold and warm color rendering algorithm called Tone Based Shading Model.

The author uses a mixture of warm and cold colors to achieve a stylized rendering effect. Unlike the traditional Phong model, where l NL \ Cdot NL ⋅ N is used to describe the relationship between the light and shade of an object, the tonal coloring model uses warm and cold tones to describe the relationship between the light and shade of an object.

meaning

The coloring model proposed by the authors uses changes in brightness and tone to indicate surface orientation, reserving extreme light and dark light for edge lines and highlights. This shading model only allows shadows to appear in mid-tone tones, allowing edge lines and highlights to remain visually prominent while also showing the shape, structure and texture of objects more clearly.

If you add some artificial tonal offsets to the shadows, you can hint at the shape of the object to some extent, without the need for a large dynamic range. Although this tonal variation can interfere with accurate albedo perception, it is not the main problem in technical illustrations.

Non-photorealistic rendering techniques in computer graphics vary greatly in the level of abstraction, such as semi-random watercolor or brush and ink, both of which have a high level of abstraction. But these are not appropriate for most technical illustrations. However, the realistic rendering technology provides too little abstraction, so the requirement of technical illustration is actually between abstraction and reality, which emphasizes the important THREE-DIMENSIONAL properties of the object and reduces or eliminates superfluous details.

Shading model

The author observed that many of the illustrations had the following characteristics:

  • The edge lines are drawn with black curves
  • The shadow intensity of a matte object is not represented by black or white, but by the coldness of the color.
  • Use a single light source to provide highlights
  • Don’t show shadows
  • The coloring of metal objects is very anisotropic (varies with direction)

The author believes that black edge lines and white highlights can provide shape information, but if you want to add shadows beyond the edge lines, only using visually different colors from black and white can provide more information. This means that the dynamic range of shadows is very limited and you need to use tonal variations to indicate surface orientation rather than a sense of intensity.

Traditional coloring method

The brightness and direction of the light in the traditional diffuse shader Settings are proportional to the cosine of the Angle between the surface normals


I = k d k a + k d max ( 0 . l ^ n ^ ) I=k_{d} k_{a}+k_{d} \max (0, \hat{l} \cdot \hat{\mathbf{n}})
  • III is the RGB color used to display a point on a given surface
  • Kdk_dkd is the DIFFUSE RGB color of the point
  • Kak_aka is the RGB color of the point’s ambient lighting
  • L ^\hat{l} L ^ is the unit vector in the direction of a point light source
  • N ^\hat{n}n^ is the normalized surface normal vector at that point

When kd= 1K_d = 1KD =1 and Ka = 0K_A = 0Ka =0 are set, the same effect as the traditional Phong model is obtained. This is obviously unsatisfactory, as both shape information and material information are hidden in the dark area.

If we make kak_aka big enough that we can visually see the shading of the dark parts completely different from the black edges, or if we add a second light source to add highlights and contrast. Also, to make the highlights visible at the top, you can lower kdK_dKD until the highlights don’t look white, and you get the following effect:

When we set
k d = 0.5 K_d = 0.5

k a = 0.1 K_a = 0.1
You can see that some of the details are lost in the dark gray areas, especially in the small claws. But no matter what the surface direction is, it’s going to be
k d k_d

k a k_a
The surface is shaded as a constant shadow.

Hue – based coloring method

In colored media, such as air brushes and pens, artists often use hue and brightness (grayscale) transformations. Adding maroon black and white to a given color produces what the artist calls a black shadow and a white hue when scales add gray to a certain color, called a hue.

In this paper, the classical computer graphics coloring model is generalized to mix the cold and warm RGB colors kcoolK_ {cool}kcool and KwarmK_ {warm}kwarm through the cosine term of the traditional equation.


I = ( 1 + l ^ n ^ 2 ) k cool  + ( 1 1 + l ^ n ^ 2 ) k warm I=\left(\frac{1+\hat{\mathbf{l}} \cdot \hat{\mathbf{n}}}{2}\right) k_{\text {cool }}+\left(1-\frac{1+\hat{\mathbf{l}} \cdot \hat{\mathbf{n}}}{2}\right) k_{\text {warm}}

As shown in the figure below, the sense of depth can be partially conveyed by tonal offsets when using levels with small brightness variations. But the lack of strong warm and cold overtones makes it look unnatural.

To automate this tonal offset technique, and to add some brightness variation when using tones, the authors chose blue to yellow tones to ensure a transition between warm and cold, regardless of the diffuse color of the object.

Kblue = (0, 0, b); B ∈ (0, 1) k_ {blue} = (0, 0, b); Kblue ∈ b (0, 1) = (0, 0, b); Kyellow ∈ b (0, 1) = (y, y, 0); Y ∈ k_ (0, 1) = {yellow} (y, y, 0); Y ∈ (0, 1) kyellow = (y, y, 0); Y ∈ (0, 1)

The author simulates the background color by linear mixing between blue and yellow and black with the hue of the object.

There are four free parameters in the formula given by the author. Using the tone range N of blue and yellow produces a very sculpted but unnatural image, which is independent of the color of the object’s diffuse reflection KDK_dKD. By changing the parameters slightly, we can see a slight difference between the two.


k cool  = k blue  + Alpha. k d k warm  = k yellow  + Beta. k d \begin{aligned} k_{\text {cool }} &=k_{\text {blue }}+\alpha k_{d} \\ k_{\text {warm }} &=k_{\text {yellow }}+\beta k_{d} \end{aligned}
  • B,yb,yb, and y determine the overall temperature shift.
  • The values of α,βα,βα,β α determine the intensity of the object’s color and brightness shift

When the free parameter selection for b = 0.4, y = 0.4, alpha = 0.2, beta = b = 0.4 0.6, y = 0.4, \ alpha = 0.2, \ beta = b = 0.4 0.6, y = 0.4, alpha = 0.2, beta = 0.6:

When the free parameter selection for b = 0.55, y = 0.3, alpha = 0.25, beta = b = 0.55 0.5, y = 0.3, \ alpha = 0.25, \ beta = b = 0.55 0.5, y = 0.3, alpha = 0.25, beta = 0.5:

The model also works with other colors

The method of directly transforming the incident light and the normal dot product in Phong model, in fact, the later cartoon rendering also used this value as a parameter to look up the corresponding color in the texture table and describe the relationship between light and shade.