Strange glColorf alpha value, texture interaction


The issue here is probably pretty basic but I couldn’t find a solution in my books. I want to draw a shape (glRect, gluDisk, polygon–same for all) on top of a texture, and have the shape blend in. So for a glRect I have

    glColor4f(1, 1, 1, 0.33);
    glRectf(-5, -5, 5, 5);

When I do this, the alpha value gets applied to the entire texture, and only partially to the rectangle. I.e., the entire texture is blended with an alpha of 0.33 into the background, and the rectangle on top of it is partially blended in but not as much as the alpha value would imply. Different alpha values produce correspondingly different results. I have earlier in the program


The projection is orthogonal; the texture has a z value of 0, the rectangle 0.1. I get the same problem on different platforms (Ubuntu, Mac OSX). Does anybody know what’s going on? Thank you–


draw a shape (glRect, gluDisk, polygon–same for all) on top of a texture

And how do you draw the texture itself ? Make sure you do it with gl color 1 1 1 1.

Thank you very much, that was it!