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

4. Shedding Some Light > Fragment Operations

Fragment Operations

As previously mentioned, the OpenGL ES 1.x lighting simulation replicated by GLKit calculates the dot product of the light direction vector and the vertex normal vector for every vertex. The dot product determines how much light hits the vertex. Then the calculated effect of lighting is interpolated between vertices to make the lighting seem smooth.

Textures enable control over the color of every rendered fragment for limited illusions of detailed lighting as in Figure 4.9. However, the GPU already performs complex calculations when determining the colors of fragments; why not use the GPU to recalculate the effect of lighting for every individual fragment instead of just for vertices? Of course, the GPU can be programmed to do just that.


  

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