Graphics Programs Reference
Texturing and Shading
In this chapter, you will learn about two common ways to enhance the look of our ES
2.0 applications — texturing and shading. First, I will talk about using single textures
and then I will show you how you can combine textures with colors. After this, you
will learn using multiple textures with rendered objects. Finally, I will discuss lighting
and shading effects in ES 2.0, which are achieved using our own logic for the interac-
tion between surface and light sources.
Vertex Buffer Objects
The per-vertex data, specified (for rendering objects) using arrays, is stored in the
main memory; however, when a call to glDraw* ( glDrawArrays or
glDrawElements ) is made, this data must be copied from the main memory to the
To avoid this we can use vertex buffer objects, which help to cache the vertex data in
GPU memory. This can significantly reduce power consumption, as well as the trans-
fer of data from main memory to GPU memory, which is otherwise incurred if we do
not use these buffer objects.