Archived

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

Easy question ( I hope)

This topic is 5016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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,

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites