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

Summary

Terrain rendering adapts mesh rendering techniques for large vertex data sets. A collection of tiles organizes terrain vertex data into chunks small enough for access by calls to glDrawElements(). The tiles also constitute a simple scene graph to enable operations including the frustum-based culling introduced in Chapter 9.

Picking based on color information encoded in a frame buffer provides fast and simple determination of the terrain coordinates under the user’s touch. The same approach works in the Mac OS X TerrainEditor application for selecting models placed within the terrain. Color-based picking provides the advantages of being relatively simple to implement and relatively fast; it takes approximately the same amount of time to render in false color for picking and it does to render normally. Almost all the computation for color-based picking runs on the GPU as opposed to the CPU. Nevertheless, other picking approaches such as ray casting that rely more heavily on the CPU might work better in some applications. For example, if the application already uses a physics simulation, ray based–picking might be available at no extra performance cost.


  

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