subd: CPU subdivision

subd is an evaluator for Catmull-Clark and Loop subdivision surfaces. All computation is done on-CPU, and evaluated surfaces are rendered to an OpenGL display list that is shown through the UI. The UI allows users to rotate the object using a crystal-ball-style interface, as well as view the edges and points of the surface. Also, for fun, I threw in a simple OpenGL cel shader and vertex normal interpolation for smooth shading.

The source of subd is available on Github and has minimal requirements (just OpenGL and GLUT).

Loop subdivision

Loop subdivision is undeniably the easier of the two methods. It only works on regular meshes containing only triangular faces; if passed a triangular mesh, subd will automatically use Loop subdivision.

Left-to-right, top-to-bottom: input mesh, mesh after three passes of loop subdivision, the same mesh with edge drawing turned off, and the same mesh with cel shading.

Catmull-Clark subdivision

Catmull-Clark subdivision is one of the more commonly-used algorithms for subdivision surfaces. It is capable of operating on any regular mesh, and the output mesh will always be triangular.

Left-to-right, top-to-bottom: input mesh, mesh after two passes of Catmull-Clark subdivision, the same mesh with edge drawing turned off, and the same mesh with cel shading.

haldean.org | released under CC BY-SA