255 is 1.0f is fully transparent, at least it happened to be that way in this case :-). Setting lower values for the alpha component didn’t work, because the alpha channel in GL_MODULATE is calculated as the product, so lower values would in fact decrease transparency. Values higher than 1.0 aren’t even possible, of course.
What I need is an OpenGL1.1-compliant version of this (strange enough, it works with my driver, which says to be (OpenGL1.1.3)):
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_ADD);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PRIMARY_COLOR);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PRIMARY_COLOR);
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);
The glBlendFunc is the regular GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA - but I can’t control the way texture and color are merged through glBlendFunc, can I?
Adding a constant value to the alpha channel is quite a common thing, e.g. if you want to let something fade out. I think there must be something in the OpenGL1.1-library to do it.
[This message has been edited by Sven2 (edited 04-28-2002).]