CS 101.3

Spring 2002

Homework 4 – Cartoon Rendering

 

This homework is intended to let you play with some techniques to render your meshes.  You will be developing a simple nonphotorealistic rendering system that includes silhouette edges and two different shading effects using OpenGL (quantized shading and the Gooch et. al shading model). 

 

The first task in the homework is to detect and render silhouette edges.  We will be using a loose combination of the approaches of  Markosian et. al. in “Realtime Nonphotorealistic Rendering” and Raskar and Cohen’s approach in  “Image Precision Silhouette Edges.”  Namely, you will detect that a given edge is a silhouette using the approach of Markosian et. al.:

Order the probability that a given edge is a silhouette edge based on its dihedral angle (edge’s with a smaller angle have higher probability)

Test 10-20% of the models edges to find a seed silhouette edge and then grow the silhouette along this edge

Now, to determine which of these silhouette edges are visible, we will use the graphics hardware and the routines provided in OpenGL.  Specifically, by drawing all silhouette edges, enabling depth testing and then rendering all triangles in white (or appropriately shaded).  You may need to play with the polygon offset mode in OpenGL to make sure that your lines have an appropriate thickness.  You need to vary the thickness of your lines based on the lighting of the model – i.e. vertices that are darker should be drawn with thicker lines (Note that there will be some discontinuities at vertices due to differing line width, which is part of why people do more complicated algorithms). Play with these techniques to arrive at something you are happy with – we will be looking reasonable visibility of silhouette lines with varying thickness.  (30 pts).

 

The second task of the homework is to shade your model using two different shading models:

The first shading model will be a cartoon type effect for shading.  You will be using a technique from “Stylized Rendering Techniques For Scalable Real-Time 3D Animation” which generates a 1D texture for all the colors of your mesh (a dark and a light version of the color).  Based on the lighting of your scene will determine which color to associate with each vertex.  To render the model you will turn off lighting and then render your colored mesh (with shading simulated by the colors you’ve assigned).  See the paper for more details (40 pts).

 

The second type of shading you will do is the Gooch et. al shading from “A Non-Photorealistic Lighting Model For Automatic Technical Illustration.” You will be doing the approximation of their model using the Phong shading model as mentioned in the paper.  We will supply you with various Kcool and Kwarm terms to experiment with. (20 pts).  (Note that this approximation assumes models are colored white).

 

Your program will need to have a drop down menu in the GUI which allows the user to choose between the various lighting models (silhouette, silhouette with cartoon shading, silhouette with Gooch). (10 pts).

 

We will be supplying you with new models which have color attributes associated with the model, however, you can start testing the silhouette and Gooch shading with the existing models.

 

For extra credit you may:

1)      Apply texture mapped lines to your silhouette edges to provide artistic effect.  Using the techniques discussed in Markosian, et. al., construct a mesh  from the spines of the silhouette lines and render “strokes” for each edge (or sequence of edges). (20 pts).

2)      Propose an extension to any of these techniques or any other NPR technique – points to be agreed upon with the TA (Zoë Wood).