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?..