Subdivision of Silhouette Edges in Interactive Time

Our project aims to detect and subdivide the silhouette edges of triangle polygonal meshes. Such silhouetting is useful for character and object prototyping, and may be used to give 3D objects a sketched or cartoony feel. Furthermore, subdividing the entire mesh may be a very expensive operation, and the silhouette provides a good target for subdivision without dramatically increasing polygon count. Introduction: Silhouetting is an important part of various subjects in computer graphics, including technical illustrations (Cole et al., 2008), line drawings (Judd, Durand and Adelson, 2007) and non-photorealistic rendering (NPR) (Hartner et al., 2003). Hertzmann and Zorin (2000) showed that such silhouetting can also be used to calculate shadow volumes. Such silhouettes can also have important applications in video games, where objects or characters may need to be quickly recognized (Mitchell, Francke, and Eng, 2007). Benichou and Elber (1999) define a silhouette edge as follows: Ei is a silhouette edge if one of its two associated polygons is locally visible from the view vector V�⃑ and the other is locally invisible. A polygon is considered locally visible if the dot product between the view vector V�⃑ and the polygon normal N�⃑ < 0, and invisible if the dot product between the view vector V�⃑ and the polygon normal N�⃑ > 0. Such edges are extremely valuable since they provide significant cues to the objects shape. Note that these silhouette edges are view dependent, that is, changing the camera angle will change the set of silhouette edges. Silhouette edges have another interesting property, in that a chain of silhouette edges always form loops on watertight models. Thus, such chains can be followed along the model rapidly. Subdivision is another important part of computer graphics, because it allows relatively low polygon count models to have higher polygon counts. This is useful for a variety of applications, including real time graphics on mobile devices (Hertzmann and Zorin, 2000). However, on such restricted devices, subdividing the entire model may be costly and wasteful – because the silhouette provides the shape and feature curves of the surface, it may be better to simply subdivide the silhouette. Zorin and Hertzmann outline several constraints for a good subdivision scheme: Interpolation, Locality, Symmetry, Generality, Smoothness, and Simplicity. They present a modified butterfly subdivision scheme which can satisfy all these requirements. The butterfly subdivision scheme is simple to implement, but unfortunately can only work with vertices that have 6 edges (valence 6). Zorin and Hertzmann expand this algorithm to work on arbitrary valence meshes. Their subdivision scheme computes a new vertex for each edge midpoint of a triangle, weighing the position of the vertex based on the surrounding vertices. In the typical subdivision scheme, those other vertices of the polygons make the shape of a butterfly, hence the name. In the modified scheme, they consider additional polygons and edges for the weighing scheme which allows them to generalize the system for arbitrary valence meshes. Starting from the work of Zorin and Hertzmann (2000) and Wang et al, we present a method to rapidly subdivide silhouette edges by using a modified butterfly subdivision scheme. We only consider Figure i: Example of front-facing and back-facing polygons. (Hartner et al., 2003) Figure ii: An example of silhouette smoothing. (Wang et al., 2010) the boundary edge case in the Zorin and Hertzmann modified subdivision scheme which uses the weight of 4 points to generate new vertices and triangles and generalize that to our subdivision algorithm. Methods: The algorithms were tested and compiled on Lenovo T410 laptops with a 2.53GHz dual-core processor with 4GB RAM and an Nvidia NVS 3100m GPU (512MB). The framework from the first assignment (Cutler, 2011) on Gouraud shading, mesh simplification, and subdivision was used and expanded to fit our needs. The silhouette edge detection was implemented by Florian. The first structure that was modified was the mesh code, as the silhouette edge detection needs to figure which edges are part of the silhouette in relation to the camera. The entire camera object (including viewing position and direction) was thus passed into the mesh code so that the silhouette edges could then be calculated. The algorithm then iterates through all edges and figured out which ones were silhouette edges. As mentioned previously, one face adjoining such edges have a normal which points towards the camera and the other has a normal which points away from the camera. It is thus simply a matter of comparing the position of the camera to the normal of the face using the dot product of those vectors. If the dot product is negative, the normal of the face is pointing in the opposite direction to the camera (a frontfacing polygon). If the dot product is positive, the normal of the face is in is the same direction as the camera (a backfacing polygon). Once those edges are found, they need to be delivered in a useful format for silhouette subdivision. The simplest and easiest method to deliver those edges to be subdivided is by delivering a vector of vector of silhouette edges. Each vector contains a loop of contiguous Silhouette edge detection pseudocode: For each edge in the mesh Get polygons of edge Test if polygons are silhouette polygons If they are, store edge in vector s While there are still silhouette edges in s Go through all silhouette edges Find out which edges link together, deleting them from s silhouette edges. These vectors are themselves packed in a vector. The silhouette subdivision was implemented by Michael. It uses a modified butterfly subdivision scheme which only considers the two edges immediately adjacent to an edge in a loop of silhouette edges and uses those four vertices to calculate the position of a new vertex in the midpoint of the edge. The weights are as follows: v0 = − 1 16 , v1 = 9 16 , v2 = 9 16 , v3 = − 1 16 . The new triangles for the subdivision are then generated using the boundary edge case of the modified butterfly subdivision scheme. A new edge is made from the midpoint of the triangle to the opposing vertex if there is one silhouette edge. New edges are created to the center of the triangle if there are two or three silhouette edges. The edges are subdivided twice. The silhouette edges of the triangle are recalculated when the camera moves. Several other features were included to help visualize and debug the silhouette subdivision, implemented by both Florian and Michael. Silhouette edges can be visualized by pressing E. Gouraud shading is available and can be triggered using G. The mesh can be reset to its original state by pressing R. The program can be quit by pressing Q. The silhouette can be manually subdivided using M. Pressing P will subdivide the silhouette in real-time. Normally, a sharp crease of more than 90 degrees or more from one edge to another is considered a corner and is not subdivided in the regular manner. However, we have made this an option instead, as it looks better. Pressing V will force the algorithm to consider sharp creases and not subdivide those. Silhouette subdivision pseudocode: For each series of silhouette edges