toon - A shader for cartoon rendering

This shader renders objects in cartoon style, similar to pen and ink. It was developed by Colin Doncaster and posted to the 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 <> or <>.

Other methods are available for cartoon-style images. The Affine Toolkit at <> for Unix/Linux environments has a tiffedge utility that converts a rendered image to a cartoon image.


Data Type



Low, High


To alter Cs to get the desired shade of Cs

Low = 0.2; High = 0.2



To define how the areas are broken up based on diffuse light

threshold = 0.1



Used to stop hard edges forming along the color change, controls the smoothstep between two colors

variance = 0.02



The color of the outter and inner lines

Edges = 0



Used to blend the base color with the edges so it fits better on the object

EdgeVal = 0.9

View the toon shader source

Download the toon package for Presenter 3D


Copyright © 1997 by WebNation
All trademarks are the property of their respective holders

Switch to Standard View