Now, we will spend some time learning how to load more than one texture into our program. We will add the colors of those two textures to create a pulsing glow effect. To do this, we will need to modify our fragment shader to receive a second texture and a time uniform variable. We will pass that variable into a sine wave function, which will use it to calculate the strength of our glowing engines. We will need to add some code to keep track of the time that has passed, as well as some new initialization code to load the second texture. We can begin by copying webgl-redux.c to a new file called glow.c. Now that we have the new glow.c file, we can walk through the changes we will need to make our glowing engine effect. The first code change is the addition of a new #define macro to define a value for 2π.
We will use a value that cycles from...