Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now, with fear and trembling, we can approach the blending of textures. Initially this seems much like the alpha blending described earlier, but all sorts of interesting things can be done by using multitexturing.
First let's rework the previous code to support two textures at once and do vertex blending. You'll have to modify Square.draw() and in createImage() from the Chapter 5 examples. The square will also need to support texture coordinates as well, and each instance of the square will need their own unique texture. The rightmost image in Figure 6–7 is what you should get if you disable blending. The center one can be generated if you activate the colors from the previous exercise and enable blending using the GL_ONE functions from earlier in this chapter.