Let there be light!
Until this point, we haven't worried about lighting. In fact, we just assumed that light would be there so that we could see our images. OpenGL has a light setting that lights everything equally. This setting is turned on, by default, until we tell OpenGL that we would like to handle the lighting.
Imagine what our scene would look like if there was no lighting. In fact, this is going to happen to you some day. You will have everything set up and ready to roll, you'll run the program, and you'll get a big, black, nothing! What's wrong? You forgot to turn on the lights! Just as shown in the following image:
Just like real life, if you don't have a source of light, you aren't going to see anything. OpenGL has many types of lights. One common light is ambient light. Ambient light appears to come from all directions at the same time, similarly to how sunlight fills up a room.
Lighting is very important in 3D games, and most games have multiple light...