Recommended Posts

I saw nehe''s program on how to move bitmaps in 3d space but like, how did it know to filter out the black background?
There is that linear filtering but I doubt that does it.
Also, do you need to put the bitmap/texture onto a surface?
I saw the glDrawPixels() that can draw bitmaps.. but hmm, i dont know.
Please help me!! thanks!

Share this post

Link to post

Share on other sites

Either load an image with an alpha channel already in it, or add the alpha channel as it''s being loaded by testing if the pixel is a certain color. Then you render while blending or alpha testing, as has been stated.

Share this post

Link to post

Share on other sites

No, it would not know that (at least not with the type of blending you''d want). You have to input one byte for every three that you load (a runtime created alpha value) to tell it whether that pixel is transparent or not. So what you do is: Read a pixel from the file, test if it is black (or whatever), if yes add a 0x00 alpha value, if no add a 0xFF alpha value, repeat until image is loaded.