overwrite alpha values only

I am writing a program that renders the different “surface qualities” in one step each. For instance: first the diffuse lighting, then the reflections (environment mapping. However, in between these two passes I want to render another pass but in this pass I only want to change the alpha values of what is already in the frame buffer. I want to keep the rgb-values intact. The alpha values will be used for blending the rgb-values from the two original passes. The problem is that in my case both of the original passes are setting the alpha values to one… and it has to be that way.

I guess I have to render the new pass using blending. But there is no blending mode that simply overwrites the destination alpha values.

So the question is: How can I render an object to the screen (using a texture), that will only change the alpha values of what is already in the frame buffer?

Please, can someone help me on his one?..

I haven’t tested but using glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_TRUE) should work … it disables the writing of R,G & B values to the framebuffer.

Oh… it’s that simple. I wasn’t aware of the glColorMask function. Thank you very much