Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: overwrite alpha values only

  1. #1
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Singapore/Sweden
    Posts
    16

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

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: overwrite alpha values only

    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.

  3. #3
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Singapore/Sweden
    Posts
    16

    Re: overwrite alpha values only

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •