Archived

This topic is now archived and is closed to further replies.

mayhem79

BIAS

Recommended Posts

I would like to take two textures display then on screen, overlapping dependant on their alpha channel. I would like to adjust the first one Red, Green and Blue values by a different fixed amounts, say -10 (uint8) or 0.1 (float) I see from the openGL specification there should be a way to do this using RED_BIAS, BLUE_BIAS, GREEN_BIAS however there is little documentation or examples (which I prefer) on using this? I would prefer to do this in the hardware if possible rather than looping through the textures and changing the values. Thankyou for reading this far Matt

Share this post


Link to post
Share on other sites
GL_*_BIAS is for pixel transfers only. That is, glDrawPixels, glTexImage and similar functions. They have no effect on rasterized primitives.

To bias a color from a texture, or a rasterized primitive in general, you can use the texture combiners. Check out this extension (it''s a part of the core API now aswell). You can use the GL_ADD_SIGNED function to add a constant color to the texture.

Share this post


Link to post
Share on other sites
Thankyou for your reply, I have had a look at the link and it will be usefull.

I was wondering if you happened to know where I could get some examples of the code being implemented.

Thanks again

Share this post


Link to post
Share on other sites