A Tessellation Example: The Teapot

All of that theory could use a concrete demonstration. In this section, we’ll render the famous Utah teapot using Bézier patches. A Bézier patch, named after French engineer Pierre Bézier, defines a parametric surface evaluated over the unit square using control points arranged in a grid. For our example, we’ll use 16 control points arranged in a 4 × 4 grid. As such, we make the following observations to help us set up our tessellation:

• Bézier patches are defined over the unit square, which indicates we should use the quads domain type that we’ll specify in our layout directive in the tessellation evaluation shader.

• Each patch has 16 control points, so our GL_PATCH_VERTICES should be set to 16 using glPatchParameteri() ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.