View Full Version : Filter channel planes!

06-10-2003, 11:03 PM

how do I separate the different RGB planes in OpenGL? Right now Im "cooking" all pixel data to get separate r/g/b channels, it must be possible to just show one channel of a buffer instead of doing it using software, right?

// Mike

06-10-2003, 11:21 PM
I don't know about only showing a single channel, but you can write to just a single channel and then displaying this normally will in essence give you that effect.
glColorMask() is the function that might be what you are looking for to do this.


06-12-2003, 06:29 AM
If performance is a consideration, using color mask with anything but all or none of the color channels may result in a performance hit, because some cards (I think NVIDIA cards in general, and possibly not ATI cards) must perform a read/modify/write to all the written pixels. The hit would be similar to blend, so it's not that big a deal in terms of frame buffer bandwidth unless you're tripling the number of passes (one per color channel for example), not to mention increasing the geometry load, etc.