Texture Vs Geometry Alpha Problem

Hi
I have a 32 bit texture that I want to render, ignoring the alpha components in the texture. However, I do need to use the alpha of the geometry that the texture is applied to, so I can’t simple disable blending. Also, the texture data is generated in realtime (not by me) and updated by me with glTexSubImage. I need the maximum performance of texture update so I cannot simple modify the colour depth of the image data to 24-bit before upload.

I have tried several methods, including different blending functionn, but do not seem to be able to create the correct end result.

Any help in this would be much appreciated.

If you want to have total control over what you are doing, you could use shaders (GLSlang/ARBfp).
Of course if your target hardware allows it.

Besides, is performance of reading into 3-component texture so bad (I haven’t tested it myself)?

can’t you just set your texture application to GL_DECAL?

something a little like this:

 glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
 

that should ignore the texture’s alpha channel.