Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We're not done with the theory yet, but let's get back to coding for a while. After that, I'll cover more on light and shading theory.
You saw in the previous examples how colors defined with the standard RGB version on a per-vertex basis would let us see it without any lighting at all. Now we will create lights of various types and position them around our so-called planet. OpenGL ES must support at least eight lights total, which is the case for Android. But of course you can create more and add or remove them as needed. If you are really picky, you can check at runtime for just how many lights a particular implementation of OpenGL supports by using one of the many variants of glGet* to retrieve the values of this: