Chapter 6. Texture Mapping


Texture mapping is a concept that takes a moment to grasp but a lifetime to master. Complex texture mapping-based algorithms such as environment mapping, depth maps, and light maps had already been developed by the late 1970s. With the recent advent of fully programmable hardware, however, texture mapping and its widespread applications remain a field of active research.

What You'll Learn

The first part of this chapter covers the nuts and bolts of texture mapping. The second part covers how your application can use texture mapping to enhance lighting effects. The chapter concludes with a brief section on debugging texture mapping problems.

Topics covered in this chapter include the following:

  • Texture mapping with texture objectsTexture objects were added to OpenGL version 1.1. They provide an efficient encapsulation of texture images and their associated texture state. In this chapter, you'll learn how to create texture objects and use them to store texture images and state.

  • Mipmapping (Williams 1983) and filteringThis section shows you how to avoid sampling artifacts by specifying mipmaps and linear filters.

  • MultitexturingOpenGL can apply multiple textures on a single primitive. This chapter shows how to bind texture objects to texture units and set the texture unit state.

  • Texture-coordinate generationMany algorithms require texture coordinates that are too complex for applications to compute on the fly. In this chapter, you'll learn how to configure OpenGL to generate texture coordinates.

  • The texture matrixThis section shows you how to specify transformations that modify texture coordinates.

  • Cube mappingOpenGL implements environment mapping with the cube map feature in version 1.3. This chapter focuses specifically on how cube maps support a specific type of environment mapping: producing accurate specular highlights on low-resolution geometry.

  • Depth mappingThis chapter discusses three ways to use texture mapping to produce shadows. One of the most powerful methods is depth mapping. The chapter also tells you how to create and use depth maps in your application.

What You Won't Learn

Texture mapping is such a vast subject that entire books are devoted to it alone. Many aspects of texture mapping are not covered in this chapter, such as the following:

  • 1D and 3D texture mapping3D textures are especially useful for volume visualization or playing short video clips as textures.

  • Texture tilingThe texture border feature, used primarily for seamlessly tiling several textures together, isn't covered.

  • TextTexture mapping is the de facto standard method for rendering 2D text in a scene. This is just one application of texture mapping not covered in this book, however.

  • Full texture stateSeveral texture parameters, such as texture priority and texture level of detail (LOD) bias, aren't covered.

  • Proxy texturesQuerying OpenGL for texture supportability isn't covered.

  • Texture compressionCompressed texture formats, which reduce the memory footprint of texture maps, isn't covered.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net