PDA

View Full Version : Colour mask with fractional values



DJABailey
01-03-2010, 11:52 AM
Sorry if this is posted in the wrong place, I'm rather new here

I would like to have a colour mask using the value 0.5 for one of the colour channels, however glColorMask(); requires a boolean value, can I achieve a similar effect without glColorMask();?

I want to see half of the blue channel whilst seeing all of the others. (as if glColor3f(1.0f,1,0f,1.0f) was actually glColor3f(1.0f,1.0f,0.5f))

Ilian Dinev
01-03-2010, 02:13 PM
"I want to <b>see</b>" - glColorMask does not change what you see. It masks what you modify.

arekkusu
01-03-2010, 02:43 PM
See the documentation for glBlendFunc().

For example you can multiply the source fragment color with a constant color (1.0, 1.0, 0.5, 1.0) before writing it to the framebuffer.

DJABailey
01-04-2010, 11:28 AM
OK, thanks guys, it works now :)