Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 6: Will It Blend? > Texture Blending

Texture Blending

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial