Graphics Pages | HOME | CS | NSM | UH |
[an error occurred while processing this directive] Cartoon-style rendering

COSC7372 Final Project: Cartoon-style rendering

Purpose

To analyze the advantages of an interactive-speed non-photorealistic rendering technique for technical models.

Methods

This project primarily involved implementing the algorithm discussed in the paper, Image Precision Silhouette Edges.

The method described involves rendering the scene twice, once in the model colors with front facing polygons, and then in black, rendering back-facing polygons in wireframe mode with the depth test set to less-than or equal. The first pass takes care of colors in the model, and sets the depth buffer up for the second pass. In the second pass, black lines are drawn only on edges where a front-facing polygon meets a back-facing polygon, resulting in the silhouette effect. This effect greatly increases the contrast of silhouette edges from the background (providing it isn't black), enhancing the rendering of the image.

Source

My implementation of this algorithm was written in C with OpenGL and GLUT extensions. [toon.c]
Program reads in an Inventor file (sometimes) and displays an interactive rendering of the model according to the rendering style.

Usage

toon -{t|f|m} [-p] filename.iv

-tCartoon rendering
-fFlat polygonal shading
-mNormal rendering, with material properties, lighting, and shading by surface normals.
-p(optional) Print framerate and number of polygons on stderr

Results

ModelPolygonsFPS ToonFPS Toon over NormalFPS NormalFPS FlatImage(s)Inventor file
SeaShell 11111111819 Toon
Normal
Toon over Normal
shell.iv
SGI Logo 864991415 Toon
Normal
Toon over Normal
SgiLogo.iv
Space Shuttle 49221202829 Toon
Normal
Toon over Normal
shuttle.iv
Torus 14511101818 Toon
Normal
Toon over Normal
torus.iv
Wheel 48612121616 Toon
Normal
Toon over Normal
wheel.iv
X29 Fighter 54121213032 Toon
Normal
Toon over Normal
X29.iv

Conclusions

As can be seen from the sample images, silhouette highlighting is a useful tool for visualizing these models. A side-effect (which might be called a feature) is that errors in the model are clearly displayed by this method, as all uncovered back-facing polygons are outlined in black as in the shuttle, shell, and torus models. (NOTE: The holes in the shuttle model are not necessarily errors in the model itself, but more likely in the rather buggy code I wrote to read Inventor files.)

It is interesting to note that, despite the two-pass method of rendering, rendering time for silhouetted images is not actually twice as slow as for non-silhouette images. In fact, the addition of material properties and lighting does not significantly increase rendering time for any of the models. While the plain silhouette images are interesting, the combination of silhouettes over smooth-rendered polygons is much more informative.

Future Work

Other avenues for extensions to this project which may be considered are:
  • Preprocessing for low-angle edges. In addition to silhouette edges, edges which meet at an acute or 90-degree angle should be considered for highlighting. Since these do not change with the view like silhouette edges, this can be done in a preprocessing step and not add significantly to the rendering time.
  • Shading quantization. A common artistic technique for shading in drawings is to shade large areas in one color despite the possible color gradations of the underlying surface. Simulation of this effect has been accomplished in Decaudin's paper, Cartoon-Looking Rendering of 3D Scenes, but not in real time.

References


Chandler Wilkerson
Last modified: Wed Dec 15 12:39:38 CST 1999
C H W i l k at U H dot E D U Last modified Saturday, 01-Jun-2002 00:22:48 CDT
[an error occurred while processing this directive]