CSE4431 Lab 06

Texture Mapping a Tesselated Quad

You can download a set of shaders and the glib file for the Bezier surface tessellation example here.

A seamless or tilable texture is a texture that can be repeated to tile a plane without any gaps or overlaps. A tilable texture is included in the zip file, and the glib file has already been modified to use the texture.

Modify the supplied shaders so that the the tesselated Bezier quadrilateral surface is tiled with the supplied texture. Note that the glib file supplies a uniform integer value uRepeat which is the number of times the texture should be repeated along the two directions of the Bezier surface (i.e., the surface should be tiled using uRepeat × uRepeat copies of the texture). The figures below show the tile texture and the texture applied to a quadrilateral patch with uRepeat = 4.

 

Phong Tessellation

Slightly modified versions of the Phong tessellation shaders discussed in class can be found here; also included is a glib file that supplies an obj object as a collection of patches (an undocumented feature of glman).

Create suitable vertex and fragment shaders that work with the supplied tessellation shaders to render the scene described by the supplied glib file; you might also require a geometry shader depending on whether you choose to perform per-vertex or per-fragment lighting. The figures below show Phong tessellation applied with outer tessellation levels of 1 and 3; a geometry shader is used to shrink the triangles and a fragment shader is used to perform per-fragment lighting.