PDA

View Full Version : Texturing Images without an Alpha



snikrot
04-06-2010, 09:10 AM
I have an image of a white text character on a black background, the image has no alpha channel. Is there a way to texture this image onto a polygon so that only the white character is drawn, i.e. ignoring the black pixels of the image.

Thanks.

dorbie
04-06-2010, 09:23 AM
You can use the blend unit to mix based on color brightness.

glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
glEnable(GL_BLEND);

There are other ways that might attempt to map the image to the alpha channel either with shaders or using a specific alpha texture format.

snikrot
04-06-2010, 10:04 AM
Thanks very much for the quick reply dorbie, I'll give that a go.

Cheers!