Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
While the last example is pretty close to perfect in terms of rendering, it still kind of lacks something. It's a bit flat. OK, OK, you already know where I'm heading with this, because it says so right in the section title, so let's add some 3D lighting.
Like backface culling, the specifics behind 3D lighting can get pretty complex and math intensive. I don't really have the space to get into a detailed discussion of all the finer points, but a quick web search will turn up more information on the subject than you could probably read in a lifetime. What I'm going to give you here are the basics, along with some functions you can use and adapt as needed.