






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Texture mapping is one of the major innovations in CG in the 1990s. It allows us to add a lot of surface detail without adding a lot of geometric primitives (lines, vertices, faces). Think of how interesting Carolineâs âloadedDemoâ is with all the texture-mapping. Figure 1 contrasts the two.
As with everything in computer graphics, most of what I know about texture mapping I learned from Angelâs book, so check that chapter first. Unfortunately, itâs one of his weakest chapters, because it doesnât do a very good job of connecting the theory with the OpenGL code. A more practical presentation is a chapter of the Red Book (the Red OpenGL Programming Guide). Youâre encouraged to look at both.
Texture mapping paints a picture onto a polygon. Although the name is texture -mapping, the general approach simply takes an array of pixels and paints them onto the surface. An array of pixels is just a picture. It might be something your program computes and uses. More likely, it will be something that you load from a file. Demos: These all live in the Ëcs307/public_html/demos/texture-mapping/ directory. USFlag: This actually shows two flags: a checkered flag and a US flag. You can switch between two flags using the âuâ key. This is about the simplest texture-mapping code. Please look at it. LitUSFlag: The US flag texture-mapped with lighting. You have to turn off the wireframe mode (âwâ) and then turn on texture-mapping (âtâ). You can also switch between having the texture interact with lighting and having a âdecal.â This code is fairly ambitious, but it shows what we can do with texture-mapping. Donât look at it until youâre ready.
Figure 1: Caroline Geiersbachâs loadedDemo with and without textures