Texture Mapping
Tom Kelliher, CS 320
Apr. 30, 2003
Work on project.
Light lab II.
- Introduction to texture mapping.
- A few issues/problems.
- Example program: checker.c
Texture lab.
- What is a texture?
- Why texture map? Complexity from simplicity.
- Where can I get textures? Fixed patterns (polygon fills), texture
generation functions, digitized images.
- Do Web browsers texture map?
- 1-D and 2-D textures.
- Texture pattern: . Stored in texture memory as array of
texels. (Texture memory and the rise of AGP.)
- Texture mapping: mapping from T to object's geometric coordinates.
(Must then map to screen coordinates.)
- Possible problems: curved surfaces, closed surfaces, pixels not
inverse mapping onto texels, aliasing.
- How is a texture mapped to an object?
- texture and vertex coordinates.
- Range of texture coordinates.
- Wrapping modes: repeat, clamp.
- How is it applied to an object?
- Modulation, decal.
- Magnification and minification. Filters.
Numbers in parentheses refer to line numbers in handouts.
- Generation of a texture: makeCheckImage() (24).
Interpretation?
- Initializing: init() (39).
- Storage formats, texture handles and binding.
- Wrapping modes.
- Minification, magnification filters.
- glTexImage2D() --- ugh.
- Rendering: display() (73).
- Enabling textures and specifying mapping mode.
- Specifying which texture.
- Binding texture and vertex coordinates.
- Comparison of code with rendered results.
Experiments:
- Is the lower right result a fluke? Rotate the lower left polygon and
see what happens.
- Specify a color for the polygons. Did anything change? Change the
mode from
GL_DECAL
to GL_MODULATE
and try again.
- Individually change the
GL_REPEAT
s to GL_CLAMP
s and see
what happens.
Brief demos of other programs, time permitting.
Thomas P. Kelliher
Tue Apr 29 15:30:37 EDT 2003
Tom Kelliher