Pro OpenGL ES for iOS

(singke) #1

184 CHAPTER 6: Will It Blend?^


Figure 6-9. The image on the left has an alpha of .5, while the figure on the right has an alpha of .75.

Multitexturing


So now we’ve covered blending for colors and mixed mode with textures and colors,
but what about combining two textures to make a third? Such a technique is called
multitexturing. Multitexturing can be used for layering one texture on top of another
while performing certain mathematical operations. More sophisticated applications
include simple image processing. But let’s go for the low-hanging fruit first.
Multitexturing requires the use of texture combiners and texture units. Texture
combiners let you combine and manipulate textures that are bound to one of the
hardware’s texture units, the specific part of the graphics chip that wraps an image
around an object. Before the iPhone 3GS, you had only two texture units to deal with,
which was a limitation of the PowerVR MBX graphics chip from Imagination
Technologies. When the 3GS came out, Apple switched to using the more powerful SGX
chip, which increased that to a total of eight texture units. If you anticipate using
combiners in a big way, you might want to verify the supported total by
Free download pdf