Changes to the main code to implement lightmaps

Let's follow the below mentioned steps to implement the lightmaps:

  1. In the main code, the first thing you'll need to change is the vertices, because at the moment we've got position and we've got the normals as well. We also need to specify the texture coordinates because we now are using a texture. You can refer to the updated vertices in the main.cpp file inside the Lighting Maps folder. Copy and paste the updated vertices to our main code.
  2. Next, go to the location where we're binding the vertex and creating the vertex pointers. As we have added a texture system to our code, we need to modify the vertex pointer and the normal attribute slightly. As we've got eight pieces of information in ...

Get Learn OpenGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.