PDA

View Full Version : texture alpha value



assmax
04-11-2005, 10:54 AM
I searched the forum but didn't come up with anything appropriate so here goes:

I am drawing different textures(that may be of different formats, including RGBA with alpha values of their own) and would like to set a specific alpha value to each texture. The value varies from texture to texture.
how is this managable?
how is this managable with gl1.1(under win)?
best practices in such situation?

thnx ;)

Jens Scheddin
04-11-2005, 12:45 PM
Vertex alpha? Ofcourse, this is not per pixel but per vertex.
You could also create a different texture for different alpha values. Each texture would have the same color data but different alpha data. This consumes a lot of memory but will work even for GL 1.1 with per pixel alpha.

Hope this helps,
Jay

assmax
04-12-2005, 12:15 AM
thnx for the reply.

i succesfuly used :

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor4f(1.0, 1.0, 1.0, alpha);is there a better way?

SeskaPeel
04-12-2005, 01:52 AM
assmax, no, this is the best method you can dream of.

SeskaPeel.

CrazyButcher
04-12-2005, 07:15 AM
if you leave gl1.1 and use ARB_texture_env_combine extension, then you could give an alpha value to the texture when its rendered, using GL_CONSTANT_ARB as source for GL_COMBINE_ALPHA_ARB