Introduction
Textures are an important and fundamental aspect of real-time rendering in general, and OpenGL in particular. The use of textures within a shader opens up a huge range of possibilities. Beyond just using textures as sources of color information, they can be used for things like additional sources of data (such as depth information), shading parameters, displacement maps, normal vectors, or other vertex data. The list is virtually endless. Textures are among the most widely used tool for advanced effects in OpenGL programs, and that isn't likely to change anytime soon.
Note
In fact, the term "texture" as it is used in OpenGL 4.0 could be considered as somewhat of a misnomer. Textures are used for many different purposes beyond just the storage of image data, and might be more accurately described as just an arbitrary chunk of memory.
In this chapter, we'll look at some basic and advanced texturing techniques. We'll start with the basics, just applying color textures, and move on...