Hi,
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
glEnable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
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–
Matt