Outline Edges |
In cartoons
individual objects are typically outlined in black ink. This dates back to the invention
of cel animation. To imitate this outlining in a painterly shader, various methods have
been developed which find the edges of 3D objects and apply an outline colour. Such
techniques have been used successfully by Disney and other animation studios. Vangogh did not outline all of the objects he painted but only those that he wanted to emphasise. To imitate this I decided to use a mixture of 2D and 3D techniques. Some Renderman shaders have already been written (and are publically available) which pick out the edges of objects at render time. However these 'toon shaders' often only work with spherical objects as they are based on the notion that at silhouette edges of objects the normal of the surface is perpendicular to the viewing vector (camera vector) - yielding a dot product of zero. This works fine for spherical objects as there is a gradual change from 'non-silhouette edge' to 'silhouette edge' but on angular objects this technique does not work (see diagram below).
Calculation for Edge outlines: n dot(I) bust be zero
To solve this problem I decided to use a Renderman shader to output reference images. This 'nizid' shader (from the 'Advanced Renderman' book) highlights the internal and external edges of objects with brighter colours. I then used these images in Chalice to enhance the edge detection algorithm.The edges produced were then composited over the rendered colour image. I could also change the colour, transparency and thickness of the edges (see following diagram).
Generating outline edges: Chalice is used to detect edges
|