Sign in to follow this  
Paprica

glColorMask() or glPixelTransferf()?

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
What? glColorMask() turns off or on writes of color to the framebuffer!

[url="http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml"]http://www.opengl.or...glColorMask.xml[/url] Edited by MARS_999

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1344137037' post='4966249']
glColorMask actually prevents writes from taking place.
glPixelTransferf is used to modify the way in which writes occur.
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this