ABSTRACT

Many computer graphics applications involve textures: images applied to surfaces of geometric shapes in three-dimensional scenes. This chapter includes all the theoretical and practical information necessary to use textures in three-dimensional scenes, including creating a texture class that handles uploading pixel data to the graphics processing unit (GPU), assigning UV coordinates to geometric objects, associating textures to uniform variables, and sampling pixel data from a texture in a shader. Advanced texture-related functionality is implemented, including procedurally generating textures, rendering text to images and displaying text in scenes, rendering scenes to textures, and applying postprocessing effects such as pixelation and vignette shading.