PDA

View Full Version : Blending question



Kilam Malik
09-11-2002, 04:18 AM
Is it possible to make the following by blending:

I have a texture which is only grayscale. I want to render this texture on a quad in front of my scene. But I want to see through the white parts of the texture and not through the black parts. Can this be done by blending functions or do I need an alpha channel?


Thanks,

Kilam.

Mazy
09-11-2002, 04:50 AM
you can add it into the framebuffer, black * anything = anything.
glBlend(GL_ONE,GL_ONE);

edit: oups.. you want the other way around.. hum, no idea, you might subtract, but the best way is to use an alphachannel

[This message has been edited by Mazy (edited 09-11-2002).]

Kilam Malik
09-12-2002, 02:58 AM
Ok, I inverted my texture. Now I can see through the black parts and have only the white parts on the screen. To switch this white parts to black I use the following blend function:

glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);

Kilam.