Chapter 16. Textures and renderbuffers
This chapter covers
In 1992, the computer game Wolfenstein 3D started a revolution and launched the genre known as the first-person shooter or FPS. Since its release, the basic elements of FPS gameplay haven’t changed: keystrokes move the character, mouse motion sets the character’s direction, and mouse clicks fire the character’s weapon.
The graphics, on the other hand, have changed dramatically. Instead of pixelated bad guys who look and move like LEGO men, monsters in modern games are rendered with such incredible detail that you can see every scale, scowl, and razor-sharp claw.
These visual improvements are made possible by textures. An OpenGL texture is an image that the renderer stretches or shrinks to cover a surface (see appendix B for a full discussion of real-time rendering with OpenGL). Simple applications apply textures to a model and don’t make any changes, but for high-quality special effects, applications use advanced image processing techniques to update the texture in real time. One prominent use for this is lighting. For example, a game developer may want the alien’s skin to change its appearance depending on whether it is being viewed by day, by night, or by night-vision goggles.