hello,
i have a question regarding the GL_COMBINE_EXT extension.
here is what i want to achieve:
i have a RGBA or RGB texture where white pixels indicate opaque and black pixels indicate transparency. i would like to map this color information to an alpha channel, so that when the texture is drawn it appears opaque where white pixels are and is transparent where black pixels in the texture are found.
can somebody give me a hint on how to do it with the GL_COMBINE_EXT extension ?
i tried this, with no luck.
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PRIMARY_COLOR_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_COLOR);
for some reason this doesnt work. what am i doing wrong here ?
i thought
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_COLOR);
is acutally the line the does it, but it doesn’t seem like it?
and another question, what does GL_PREVIOUS_EXT mean in the following command:
glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
any help is greatly appreciated!