Let's discuss lightmaps in this section. But first, let's try to understand what a lighting map is. Well, in the real world, if you have, let's say, a crate that is partly metal and partly wood, similar to the following screenshot:
The wooden parts of it will react differently to the light compared to the metal parts. It might sound obvious, but OpenGL (or any other sort of 3D graphics API) doesn't have a concept of wood or metal or plastic, or anything else and as a result, we need to program that in. We need to use other techniques to help illustrate that visually as the wood should be less shiny than the metal parts of the crate. If you search on lighting maps, you'll get a bunch of information. You can create them in various tools. You can use Maya or Photoshop to create them. So, without further ado, let's get down to the coding...