Homework 3 - CS294-13 - Advanced Computer Graphics

Professors: Ravi Ramamoorthi & James O'Brien

Florian Hecht

fhecht at cs.berkeley.edu
545 Soda Hall
Cell: (510) 717-8562


Catmull-Clark Subdivision Surfaces

Catmull-Clark subdivision surfaces are a popular modelling technique for characters in animated movies, since they allow multi resolution control over the shape of an object. The limit surface, the subdivision approaches is smooth and has very nice properties. And since finer and finer approximations to this limit surfaces can be generated in a recursive fashion, they have also nice properties for a level-of-detail based rendering.

One of the issues with Catmull-Clark sudivision surfaces was that it wasn't possible to directly evaluate the limit surface properties, due to the possibly irregular nature of the mesh structure. For regular regions (all faces are quads and every vertex has a valence of 4) the CC surface patches are B-spline patches, but for vertices with a valence different than 4 this not true anymore. Thankfully Jos Stam came to the rescue and came up with a way to exactly evaluate the limit surface, by means of projecting the control points for any vertex (even those without valence of 4) into an eigne basis of patches. From which he is then able to reconstruct a smooth patch even for extraordinary vertices. From said patches all the interesting properties like position, normal and derivatives can be caluclated very similar to regular B-spline patches.

Part I: Basic implementation & exact evaluation

We implemented an OBJ-file loader, which can turn any mesh into a subdivided version, which in turn can be subdivided, creating iteratively finer and finer versions of the mesh. The subdivision step consideres a sharpness flag for each vertex, edge or face and does not move vertices flag as sharp and flags each vertex created from a sharp edge or face ads sharp again. With these flags it is possible to force certain vertices/edges/faces to certain locations, as specified in the OBJ file. The entry for texture coordinates in the OBJ file is abused as a sharpness flag.

The method presented by Jos Stam in [1], extends this iterative method with a direct way to evaluate the limit surface. Stam provides the precalculated eigenbasis, eigenvalues and interpolation values for vertices up to a valence of 50 on his webpage, together with a simple loading routine. We added these components to our program and implemented the projection and exact evaluation. We can then render each quad of the control mesh as a B-spline patch that has been taken to the limit surface, creating a high res and very smooth surface. The exact evaluation does not honor the sharpness flag of the vertices though. That means sharp features are rounded off. This can be limited by subdividing the mesh several times before taking it to the limit with B-spline patches.

Implementing the paper is not completly trivial as floating point errors creap in at several occations. Furthermore a complete connectivity of the mesh is needed, which requires loading and update of this information during the subdivision process.

With the exact evaluation, one can then calculate surface metrics like the gaussian and mean curvature. Which are then visualized on the B-pline patches.

Part II: Minimizing the squared mean curvature of the surface

We implemented two minimization methods: Simulated Annealing and Laplacian-Surface smoothing.

The simulated annealing method is very slow, as expected. In fact, grass grows fast than this method optimizes the surface. Furthermore the steps take from each iteration to the next need to be small enough otherwise the controll mesh gets very noisy and the limit surface becomes ugly, though very smooth locally. Given small enough steps the method converges, though we didn't wait for that.

The Laplacian smoothing method is considerably fast and gives decent results if the steps are not too big. Laplacian smoothing moves each point towards the average its neighbors, the amount it moves is varaible of the method. Unfortunately this has a shrinking effect for convex regions. To counter that we apply an "inverse" smoothing after the initial step with an negative step size, in which the points are pushed out again: smooth(k); smooth(-k); 0 < k < 1. We use and explicit step for the smoothing. An implicit solve of the laplace matrix of all vertices, would allow much greater time steps.

We modified the laplacian smoothing to take into account the local mean curvature of a point. With that, the points which have a high mean curvature are smoothed the fastest and points with a curvature of zero aren't modified anymore.

For the smoothing we can restrict the optimization to certain points. So we can preserve sharp features even with the smoothing. For the images below we didn't do that, since the non sharp points are already smooth and smoothing them is barely visible. We therefore smooth the whole mesh. Also note, since our smoothing is using the mean curvature as measure in both methods, we need at least two subdivision steps to apply Stam's evaluation method.

Result Images

The control points of a slightly distorted box (two bottom vertices are pulled up a bit). The green vertices are "sharp" as are the red edges.
The control points of level 1 of the subdivision. Note how the sharp parts didn't move and how the sharpness flag was propagated.
We reached subdivision level 2 at which point we can use Jos Stam's method to get to the limit surface.
A shaded version of the control mesh. Not very pretty.
The same in wireframe mode.
The limit surface rendered as a B-spline patches. Each quad of the control mesh is replaced by a 4x4 quad patch with position and normal determined by the B-spline patch. Patches with an extraordinary vertex are marked in light blue.
The whole thing in wireframe mode.
Visualization of the gaussian curvature. The greener the color the more positive the gaussian curvature is. Negative curvature would be re.
Visualization of the mean curvature.
Different perspective. You clearly see the high curvature on the sharp edges of the original control mesh.
Pentagon like object with two sharp vertices.
Level 1
Level 2
Rendered as B-splines
Mean curvature visualization. Squared mean curvature of whole surface: 5.413171.
After 20 iterations of laplacian smoothing (not using local mean curvature). Squared mean curvature of whole surface: 2.530430.
After 20 iterations considering the local mean curvature. Squared mean curvature of whole surface: 2.388982.
After ~120 iterations (not using local mean curvature).
Capital lambda shaped object (or flipped L).
Level 1
Level 2
Rendered as B-splines. Squared mean curvature of whole surface before smoothing: 2.040620.
After 60 iterations of laplacian smoothing: Squared mean curvature: 0.629098
The modified control mesh.

References

Source Code

subdivision.zip