This shader renders objects in cartoon style, similar to pen and
ink. It was developed by Colin Doncaster and posted to the comp.graphics.rendering.renderman
newsgroup. Typically, the shader draws ink lines at the edges of
objects, and fills the interior area with a constant color. To see how toon works, compare the image of two lions below. The
lion on the left was rendered with the toon shader. The lion on the
right uses the plastic shader. If your browser has the QuickTime 3 plug-in, you can view this
animation of the lion with the toon shader. To render the ink lines along the object edges as seen from the
camera, use a spotlight that is aligned colinear with the camera. The
camera and spotlight should be aimed at the same point and angle. If
you need to move the camera for animation, it may be useful to place
the camera and spotlight in a folder, then move the folder to keep
the camera and spotlight synchronized. The the lion rendering used the default values for shader
parameters, except for threshold. Larger values of threshold
tend to thicken the edge lines and bring out more detail. Most of the
objects in the lion used threshold=0.5, but a few objects were set as
high as 0.75. Shadows can have a significant effect on objects using the toon
shader. The lion rendering was done with shadows turned off. Colin Doncaster, the author of the toon shader, can be emailed at
<colind@name.net> or
<colind@calibre-dd.com>. Other methods are available for cartoon-style images. The Affine
Toolkit at <http://www.affine.com>
for Unix/Linux environments has a tiffedge utility that
converts a rendered image to a cartoon image.
Shaders
toon - A shader for cartoon rendering
Parameter |
Data Type |
Usage |
Example |
---|---|---|---|
Low, High |
float |
To alter Cs to get the desired shade of Cs |
Low = 0.2; High = 0.2 |
threshold |
float |
To define how the areas are broken up based on diffuse light |
threshold = 0.1 |
variance |
float |
Used to stop hard edges forming along the color change, controls the smoothstep between two colors |
variance = 0.02 |
Edges |
color |
The color of the outter and inner lines |
Edges = 0 |
EdgeVal |
float |
Used to blend the base color with the edges so it fits better on the object |
EdgeVal = 0.9 |
Download the toon package for Presenter 3D