Easy question ( I hope)

Started by
0 comments, last by Lufian 20 years, 1 month ago
Here''s a simple question that I do not bear the answer. If a targa image let say a blue ball has a white background (technically the background color could be changed), how could I make the background transparent without altering the blue ball? I''ve tried glBlendFunc and glAlphaFunc, but both ended up altering the entire image. Thank you,
Advertisement
You need to set use the alpha channel of the texture to implement tranparency, then use alpha testing to make certain parts of the texture transparent. You can either use tga''s for textures (as they have an alpha channel) or build your alpha channel on the fly as you load in a bmp or whatever.

Look at NeHe''s IPicture code, this implements what you want and gives you all the code you need. In it he sets black to be the transparent colour, but you could change this to white or whatever you want.

Hope this helps.

This topic is closed to new replies.

Advertisement