






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of texture mapping, a technique used in computer graphics to apply a 2d texture onto a 3d surface. The basics of texture mapping, including how it works, different innovations like bump mapping and environment mapping, and how to implement texture mapping in opengl. It also provides examples and code snippets.
Typology: Study notes
1 / 12
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