Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: There can be only one

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Orange, CA

    There can be only one

    Hey all,
    i was wondering if there is a blend function that would eliminate a certian color within a function. Is that at all possible with opengl? thanks for you help


  2. #2
    Intern Contributor
    Join Date
    Mar 2001

    Re: There can be only one

    You didn't say if you wanted to have the source color masked or the destination color masked, or both so I will tell you this much-

    You can perform blending ops with a Source multiplier as the Destinations color, or vice-versa. I suppose if you made your source a Red material for example, you could use it as a Destination multiplier and that would remove the Green/Blue components from your destination. Something along these lines-

    *** Draw object ***

    This would filter the Destination(what is already drawn) by the Source(Object drawn) by the Color of the source.

    You can also use-

    This would have the inverse effect. Where Red is fully bright it would be removed.

    If you are looking to simply filter the colors being drawn, you may wish to use-

    void glColorMask(
    GLboolean red,
    GLboolean green,
    GLboolean blue,
    GLboolean alpha

    This will enable you to filter certain colors from being written to the color buffer, but be aware, this causes a big performance hit.

Posting Permissions

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