alpha blending

blending works excellent for colors such as glColor4f(1,1,1,.5) which sets 50% blended white polygons… but when i have a texture on the polygon, i would like to specify an alpha value using something like glColor4f(1,1,1,.25) to change the amount of transparency for that polygons texture, and it doesn’t quite work that way. The only way i know of that i can change the transparency amount for texturing, is by changing the alpha value in the texture itself when i load it in from the bitmap. is there a way i can easily do it the way i would like?

Make sure that the texture has a GL_MODULATE texture environment and it should work.

If you want to control the transparency level of a texture you could use an interpolation texture combiner function.

either look up ‘texture combiner functions’ on google or in the OpenGL redbook (pg. 442 of the 1.4 book)

dorbie’s method will in fact ‘blend’ the texture with the surface it is being applied to but it’s a blend by multiplication. You yourself have no control over the actual transparency of the texture.