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 5. Textures and Image Capture > Texture Coordinates Revisited

5.2. Texture Coordinates Revisited

Recall that texture coordinates are defined such that (0,0) is the lower-left corner and (1,1) is the upper-right corner. So, what happens when a vertex has texture coordinates that lie outside this range? The sample code is actually already sending coordinates outside this range. For example, the TextureCount parameter for the sphere is (20,35).

By default, OpenGL simply repeats the texture at every integer boundary; it lops off the integer portion of the texture coordinate before sampling the texel color. If you want to make this behavior explicit, you can add something like this to the rendering engine code:


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint