Computer Graphics Systems
A Renderer Built from Scratch in C++
Four rendering and animation systems, built from scratch in C++ with no graphics framework underneath them, for Carnegie Mellon’s Computer Graphics course (15-362/662): a CPU rasterization pipeline, a half-edge mesh editor, a Monte Carlo path tracer, and a skeletal animation/IK system. All renders below are real output from my own code, not a mockup.
At a glance
- Role: Solo
- Stack: C++, no external rendering framework
- Context: 15-362/662 Computer Graphics, Carnegie Mellon
- Scope: Rasterizer, MeshEdit, PathTracer, and Animation assignments
Rasterizer
- Projects every triangle in a scene onto the screen and fills in the pixels it covers.
- Barycentric interpolation: blends a triangle’s per-vertex properties (depth, normal, color) across its interior.
- Z-buffer: resolves which triangle is actually closest to the camera at each pixel when several overlap.
- Phong-style shading: computes per-pixel lighting from interpolated surface normals instead of flat per-triangle color.
MeshEdit
- Built a half-edge mesh: every edge splits into two directed half-edges, each aware of its neighboring face, vertex, and the half-edge across from it.
- Makes walking a mesh’s topology (every face around a vertex, every neighbor of a triangle) a handful of pointer hops instead of a linear scan.
- Implemented subdivision, smoothing, normal computation, and general geometric transformations on top of that structure.
PathTracer
- Solves the rendering equation by Monte Carlo integration: cast a ray per pixel, recursively sample bounces off the scene, average many random samples per pixel to estimate how much light reaches the camera.
- BVH (bounding volume hierarchy): prunes most of the scene out of consideration for a given ray before exact intersection math, since testing every ray against every object is unusably slow.
- Variance reduction: getting a clean image out of a noisy Monte Carlo estimator without just brute-forcing more samples, where a meaningful chunk of the real engineering in a path tracer lives.
Animation
- Splines: keyframed motion curves.
- Skeletal skinning: binds mesh geometry to an underlying joint hierarchy.
- Inverse kinematics: poses a character from end-effector targets instead of hand-setting every joint angle.
What this taught me about systems
- Performance problems in graphics are almost always structural, not computational. The BVH doesn’t make ray-triangle intersection faster, it makes you do far fewer of them.
- A good data structure is the real deliverable. The half-edge mesh took longer to get right than either renderer built on top of it, and both renderers got simpler once it existed.
- Correctness in a renderer is visual, not just logical. A subtly wrong interpolation or an off-by-one in the z-buffer doesn’t throw an error; it just looks wrong, which makes rigorous testing (not just “does it look okay”) matter more, not less.