Jump to content
  • Advertisement
Sign in to follow this  
Paprica

glColorMask() or glPixelTransferf()?

This topic is 2237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? Edited by Paprica

Share this post


Link to post
Share on other sites
Advertisement
glPixelTransferf(GL_X_SCALE, 0) would do the same thing as glColorMask(GL_FALSE) will do. wouldn't it?

Share this post


Link to post
Share on other sites
glColorMask actually prevents writes from taking place.
glPixelTransferf is used to modify the way in which writes occur.

Share this post


Link to post
Share on other sites

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? Edited by MARS_999

Share this post


Link to post
Share on other sites
Like I said, the goal is to completely discard an RGB component. Edited by Paprica

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!