glColorMask() or glPixelTransferf()?

Started by
5 comments, last by Brother Bob 11 years, 8 months ago
Which one is better to use when drawing pixels using glDrawPixels()?
I first learned about glPixelTransferf(), but then I was introduced to glColorMask() and it seems like it does the same job (only when the goal is to completely discard an RGB component) AND it's more simple.
Which one is better?
Advertisement
What? glColorMask() turns off or on writes of color to the framebuffer!

http://www.opengl.or...glColorMask.xml
glPixelTransferf(GL_X_SCALE, 0) would do the same thing as glColorMask(GL_FALSE) will do. wouldn't it?
glColorMask actually prevents writes from taking place.
glPixelTransferf is used to modify the way in which writes occur.

glColorMask actually prevents writes from taking place.
glPixelTransferf is used to modify the way in which writes occur.


Hence this is what I said

glColorMask — enable and disable writing of frame buffer color components

I guess what should be done here is ask... what are you trying to do with these functions?
Like I said, the goal is to completely discard an RGB component.
The color mask is the only way to prevent a color channel from being written to the framebuffer. Setting the pixel transfer scale to zero will write a zero for that channel instead of discarding it. The two functions cannot be compared because their functionalities don't overlap.

This topic is closed to new replies.

Advertisement