Lecture 10:
Texture Mapping

Contents

Lecture Objectives

10-1

What is a Texture?

10-2

What Information Does a Texture Contain?

10-3

read_texture()

10-4

read_texture() Array Format

10-5

What is Texture Mapping?

10-6

Specifying a 2D Texture

10-7

What if the Texture is the Wrong Size?

10-8

Scaling Texture Images

10-9

Texture Coordinates

10-10

Setting Texture Coordinates Explicitly

10-11

Which Texel Goes With Which Pixel?

10-12

Specifying Filters

10-13

How Filters Work

10-14

Enabling Texture Mapping

10-15

Example: texture.c

10-16

Lab: Basic Texture Mapping

10-17

Multiple Textures

10-18

Using Texture Objects

10-19

A Simple Texture Object Example

10-20

Multiple Levels of Detail

10-21

Creating Mipmaps Automatically

10-22

Mipmapped Minification Filters

10-23

Example: mipmap.c

10-24

Changing the Texture Environment

10-25

Texture Environment and 4-Component Textures

10-26

Texture Environment and Transparency

10-27

Example: texenv.c

10-28

Automatic Texture Coordinate Generation

10-29

Generating Texture Coordinates

10-30

Example: texgen1.c

10-31

Mapping Textures Smoothly onto 3D Objects

10-32

A Textured Quadric

10-33

Example: texgen2.c

10-34

Lab: Adding Textures

10-35

Lecture Summary

10-36

OpenGL C Quick Reference

10-37