Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 5.52 KB

README.md

File metadata and controls

43 lines (34 loc) · 5.52 KB

Utah Teapots

Note this was initially inspired by the SIGGRAPH talk here and the demos were written using PyNGL and claude to see how well Agentic AI could write the code. At present the code is 100% generated by the AI. I will write this up at some point in my blog.

<iframe width="560" height="315" src="https://www.youtube.com/embed/k-23LgrFcvs?si=nX-D63jDh5Qv8TjT" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

A series of demos built around Martin Newell's teapot. Newell drew it on graph paper at the University of Utah in 1975 and typed in the Bezier control points by hand. Jim Blinn squashed it to 3/4 of its height in 1976, Frank Crow gave it a bottom in 1987, Hank Driskill made it a trimmed NURBS solid in 1992, Russ Fish rewrote that as a program in 2006, and it has been the default test object in graphics ever since (it is Prims.TEAPOT in PyNGL). The Utah Graphics Lab page has the full history. Rather than loading a mesh, these demos go back to the original patch data and build the surface ourselves, so we can look at each step along the way.

Each demo lives in its own folder with a README, and most have an OpenGL and a WebGPU application sharing the same Python code. It is expected you will use uv to run them, from the repository root:

uv run python UtahTeapots/NewellPatches/main.py         # OpenGL
uv run python UtahTeapots/NewellPatches/main_webgpu.py  # WebGPU
uv run python UtahTeapots/BlinnTeapot/main.py
uv run python UtahTeapots/BlinnTeapot/main_webgpu.py
uv run python UtahTeapots/CrowTeapot/main.py
uv run python UtahTeapots/CrowTeapot/main_webgpu.py
uv run python UtahTeapots/DriskillTeapot/main.py
uv run python UtahTeapots/DriskillTeapot/main_webgpu.py
uv run python UtahTeapots/FishTeapot/main.py
uv run python UtahTeapots/FishTeapot/main_webgpu.py
uv run python UtahTeapots/YukselTeapot/main.py
uv run python UtahTeapots/YukselTeapot/main_webgpu.py

Demos

Preview Demo Description
NewellPatches The 32 Bezier patches tessellated with NumPy (OpenGL) and in a compute shader (WebGPU), with the control net, normals and patch structure drawn over the top
BlinnTeapot The teapot built from Blinn's swept outlines and mirrored handle and spout: Newell 1975, Blinn 1976 and Crow 1987 versions, sweep animation and the quarter circle error
CrowTeapot Frank Crow's 1987 wire frame program: curves of constant u and v, hidden line removal with polygon offset / depth bias, and a replay of the plot
DriskillTeapot Hank Driskill's 1992 trimmed NURBS solid: an exact rational circle, the inside, a spout that pours, trim textures, and a NURBS evaluator in a compute shader
FishTeapot Russ Fish's 2006 SCL rework: modelling as a program (knot insertion, degree elevation, sweeps), his cleaver and butcher block scene, stencil capped sections and fake shadows
YukselTeapot Cem Yuksel's 2026 version: the seams made curvature continuous by degree elevation or by splitting, reflection lines and curvature colours to see it, a solid interior with a solid knob, and both bottoms

Background