174 CHAPTER 6: Will It Blend?^
Figure 6-3. Blending full intensities of red and blue
Now it’s time for another experiment of sorts. Take the code from the previous example,
set both alphas to 0.5, and reset the blend function back to the traditional values for
transparency:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
After you run this modified code, take note of the combined color, and notice that the
further square is blue at -4.0 away and is also the first to be rendered, with the red one
as the second. Now reverse the order of the colors that are drawn, and run. What’s
wrong? You should get something like Figure 6-4.