Pro OpenGL ES for iOS

(singke) #1

Chapter 5


Textures


The true worth of a man is not to be found in man himself but in the
colours and textures that come alive in others.

-----Albert Schweitzer

People would be a rather dull bunch without texture in their lives. Removing those
interesting little foibles and eccentricities would remove a little of the sheen in our daily
wanderings, be they odd but beguiling little habits or unexpected talents. Imagine the
high-school janitor who happens to be an excellent ballroom dancer, the famous
comedian who must wear only new white socks every day, the highly successful game
e n g i n e e r w h o ’ s a f r a i d t o w r i t e l e t t e r s b y h a n d -----all can make us smile and add just a little
bit of wonder through the day. And so it is when creating artificial worlds. The visual
perfection that computers can generate might be pretty, but it just doesn’t feel right
if you want to create a sense of authenticity to your scenes. That’s where texturing
comes in.


Texture makes that which is perfect become that which is real. The American Heritage
Dictionary describes it this way: ‘‘The distinctive physical composition or structure of
something, especially with respect to the size, shape, and arrangement of its parts.’’
Nearly poetic, huh?


In the world of 3D graphics, texturing is as vital as lighting in creating compelling images
and can be incorporated with surprisingly little effort nowadays. Much of the work in the
graphics chip industry is rooted in rendering increasingly detailed textures at higher
rates than each previous generation of hardware.


Because texturing in OpenGL ES is such a vast topic, this chapter will be confined to the
basics, with more advanced topics and techniques reserved for the next chapter. With
that in mind, let’s get started.

Free download pdf