i
i
i
i
i
i
i
i
Chapter 11
Non-Photorealistic Rendering
“Using a term like ‘nonlinear science’ is like referring to the
bulk of zoology as ‘the study of nonelephant animals.’
—Stanislaw Ulam
Photorealistic rendering attempts to make an image indistinguishable from
a photograph. Non-photorealistic rendering (NPR), also called stylistic
rendering, has a wide range of goals. One objective of some forms of NPR
is to create images similar to technical illustrations. Only those details
relevant to the goal of the particular application are the ones that should
be displayed. For example, a photograph of a shiny Ferrari engine may be
Figure 11.1. A variety of non-photorealistic rendering styles applied to a coffee grinder.
(Generated using LiveArt from Viewpoint DataLabs.)
507
i
i
i
i
i
i
i
i
508 11. Non-Photorealistic Rendering
useful in selling the car to a customer, but to repair the engine, a simplified
line drawing with the relevant parts highlighted may be more meaningful
(as well as cheaper to print).
Another area of NPR is in the simulation of painterly styles and natural
media, e.g., pen and ink, charcoal, watercolor, etc. This is a huge field
that lends itself to an equally huge variety of algorithms that attempt to
capture the feel of various media. Some examples are shown in Figure 11.1.
Two different books give thorough coverage of technical and painterly NPR
algorithms [425, 1226]. Our goal here is to give a flavor of some algorithms
used for NPR in real time. This chapter opens with a detailed discussion of
ways to implement a cartoon rendering style, then discusses other themes
within the field of NPR. The chapter ends with a variety of line rendering
techniques.
11.1 Toon Shading
Just as varying the font gives a different feel to the text, different styles
of rendering have their own mood, meaning, and vocabulary. There has
been a large amount of attention given to one particular form of NPR, cel
or toon rendering. Since this style is identified with cartoons, it has strong
connotations of fantasy and (in the West, at least) childhood. At its sim-
plest, objects are drawn with solid lines separating areas of different solid
colors. One reason this style is popular is what McCloud, in his classic
book Understanding Comics [834], calls “amplification through simplifica-
tion.” By simplifying and stripping out clutter, one can amplify the effect
of information relevant to the presentation. For cartoon characters, a wider
audience will identify with those drawn in a simple style.
The toon rendering style has been used in computer graphics for well
over a decade to integrate three-dimensional models with two-dimensional
cel animation. It lends itself well to automatic generation by computer
because it is easily defined, compared to other NPR styles. Games such as
Okami and Cel Damage have used it to good effect. See Figure 11.2.
There are a number of different approaches to toon rendering. For
models with textures and no lighting, a solid-fill cartoon style can be ap-
proximated by quantizing the textures [720]. For shading, the two most
common methods are to fill the polygonal areas with solid (unlit) color or
to use a two-tone approach, representing lit and shadowed areas. Solid
shading is trivial, and the two-tone approach, sometimes called hard shad-
ing, can be performed by remapping traditional lighting equation elements
to different color palettes. This approach is related to the lighting model
work by Gooch et al. [155, 423, 424] for NPR technical illustration. Also,
silhouettes are often rendered in a black color, which amplifies the cartoon
look. Silhouette finding and rendering is dealt with in the next section.
i
i
i
i
i
i
i
i
11.1. Toon Shading 509
Figure 11.2. An example of real-time NPR rendering from the game Okami. (Image
courtesy of Capcom Entertainment, Inc.)
Lake et al. [713, 714] and Lander [721] both present the idea of comput-
ing the diffuse shading dot product n ·l for each vertex and using this value
as a texture coordinate to access a one-dimensional texture map. This can
be done on the CPU or implemented as a simple vertex shader [714, 725].
The texture map itself contains only the two shades, light and dark. So,
as the surface faces toward the light, the lighter shade in the texture is
accessed. The standard use of the diffuse term is that n · l < 0means
the surface is facing away from the light and so is in shadow. However,
this term can be used and remapped to any other values as desired. For
example, in Figure 11.3, the two-tone rendering uses a threshold value
of 0.5. Similarly, simple one-dimensional textures can be used to remap
the effect of specular highlights. Card and Mitchell [155] describe how to
perform this shading algorithm efficiently on the GPU. Barla et al. [66]
add view-dependent effects by using two-dimensional maps in place of one-
dimensional shade textures. The second dimension is accessed by the depth
or orientation of the surface. This allows objects to smoothly soften in con-
trast when in the distance or moving rapidly, for example. Rusinkiewicz
et al. [1092] present an interesting alternate shading model that goes the
i
i
i
i
i
i
i
i
510 11. Non-Photorealistic Rendering
Figure 11.3. On the left, a Gouraud-shaded duck. The rest of the ducks have silhouettes
rendered, with solid shading, diffuse two-tone shading, and specular/diffuse three-tone
shading. (Reprinted by permission of Adam Lake and Carl Marshall, Intel Corporation,
copyright Intel Corporation 2002.)
opposite direction, giving a high-contrast, hyperreal feel to surface shading
by adjusting the effective light position.
11.2 Silhouette Edge Rendering
Algorithms used for cel edge rendering reflect some of the major themes
and techniques of NPR. Isenberg et al. [589] present a thorough survey
of this topic. Our goal here is to present algorithms that give a flavor of
the field in general. Silhouette methods used can be roughly categorized
as based on surface angle, procedural geometry, image processing, vector
edge detection, or a hybrid of these.
There are a number of different types of edges that can be used in toon
rendering:
A boundary or border edge is one not shared by two polygons, e.g.,
the edge of a sheet of paper. A solid object typically has no boundary
edges.
A crease, hard,orfeature edge is one that is shared by two polygons,
and the angle between the two polygons (called the dihedral angle)is
greater than some predefined value. A good default crease angle is
60 degrees [726]. Alternately, a crease edge is one in which the vertex
normals differ between the two neighboring polygons. For example,
i
i
i
i
i
i
i
i
11.2. Silhouette Edge Rendering 511
CS
CS
CS
C
S
M
M
B
B
B
B
B
B
C
C
C
Figure 11.4. A box open on the top, with a stripe on the front. The boundary (B),
crease (C), material (M ), and silhouette (S) edges are shown.
a cube has crease edges. Crease edges can be further subcategorized
into ridge and valley edges.
A material edge appears when the two triangles sharing it differ in
material or otherwise cause a change in shading. It also can be an
edge that the artist wishes to always have displayed, e.g., forehead
lines or a line to separate the same colored pants and shirt.
A silhouette edge is one in which the two neighboring triangles face in
different directions compared to some direction vector, typically one
from the eye.
See Figure 11.4. This categorization is based on common usage within
the literature, but there are some variations, e.g., what we call crease and
material edges are sometimes called boundary edges elsewhere. While our
focus here is toon rendering, there has been research on drawing lines that
represent contours, ridges, and valleys on the surface [236, 616] or highlights
from illumination [237].
For toon rendering, the direction used to define silhouette edges is the
vector from the eye to some point on the edge. In other words, silhouette
edges are those for which one neighboring triangle is frontfacing and the
other is backfacing. Note that this computer graphics definition is a little
different than what is commonly meant by a silhouette, i.e., the outer
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset