Architecture
Why Fast Subdivision?
Subdivision surfaces are commonly used for final rendering of character shapes for a smooth and controllable limit surfaces. However, subdivision surfaces in interactive apps are typically drawn as their polygonal control hulls because of performance. The polygonal control hull is an approximation that is offset from the true limit surface. Looking at an approximation in the interactive app makes it difficult to see exact contact, like fingers touching a potion bottle or hands touching a cheek. It also makes it difficult to see poke-throughs in cloth simulation if the skin and cloth are both approximations. This problem is particularly bad when one character is much larger than another and unequal subdiv face sizes cause approximation errors to be magnified.
Maya and Pixar’s proprietary Presto animation system can take 100ms to subdivide a character of 30,000 polygons to the second level of subdivision (500,000 polygons). By doing the same thing in 3ms, OpenSubdiv allows the user to see the smooth, accurate limit surface at all times.
Heritage
This is the fifth-generation subdiv library in use by Pixar’s proprietary animation system in a lineage that started with code written by Tony DeRose and Tien Truong for Geri’s Game in 1996. Each generation has been a from-scratch rewrite that has built upon our experience using subdivision surfaces to make animated films. This code is live, so Pixar's changes to OpenSubdiv for current and future films will be released as open source at the same time they are rolled out to Pixar animation production.
The technology here is based on the work by Niessner, Loop, Meyer, and DeRose in:
http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf
Components
hbr (hierarchical boundary rep)
This base library implements a half edge data structure to store edges, faces, and vertices of a subdivision surface. Julian Fong on the RenderMan team originally wrote this code. It is the lowest-level subdivision library in RenderMan. Separate objects are allocated for each vertex and edge (*2) with pointers to neighboring vertices and edges. Hbr is a generic, templated API used by clients to create concrete instances by providing the implementation of the vertex class.
far (feature-adaptive rep)
Far uses hbr to create and cache fast run time data structures for table driven subdivision of vertices and cubic patches for limit surface evaluation. Feature-adaptive refinement logic is used to adaptively refine coarse topology near features like extraordinary vertices and creases in order to make the topology amenable to cubic patch evaluation. Far is also a generic, templated algorithmic base API that clients in higher levels instantiate and use by providing an implementation of a vertex class. It supports these subdivision schemes:
- Catmull-Clark
- Loop
- Bilinear
osd (Open Subdiv)
Osd contains client-level code that uses far to create concrete instances of meshes. These meshes use precomputed tables from hbr to perform table-driven subdivision steps with a variety of massively parallel computational backend technologies. Osd supports both uniform subdivision and adaptive refinement with cubic patches. With uniform subdivision the computational backend code performs Catmull/Clark splitting and averaging on each face. With adaptive subdivision the Catmull/Clark steps are used to compute the CVs of cubic patches, then the cubic patches are tessellated on with GLSL or DirectX.
OpenSubdiv enforces the same results for the different computation backends with a series of regression tests that compare the methods to each other.