Sign in to follow this  

Alpha Zone on Targa Texture just won't show alpha

Recommended Posts

Hi Everyone, I found a targa loader that works great and implemented it in my code.

But for some reason, the alpha region of my texture , just won't be alpha when I load the Texture in my code.

If I make a texture that is a full purple colored rectangle, and carve out the central part with an alpha zone, in-game the quad is all full purple, instead of having the central part being transparent.

I tried the following code too, and it doesn't work, I don't understand
glEnable(GL_BLEND); // Enable Blending


glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Set The Blending To A Nice 50/50 Mode
glDisable(GL_BLEND); // Disable Blending

Draw Function, basically draws a Quad and applies the texture to it.

Can anybody help me understand whats missing I'm just trying to get textures with alpha to work, I usually work with targas, so thats why I got a targa loader.


Share this post

Link to post
Share on other sites

Are you sure your texture has a proper alpha channel? What program did you use to make it, and have your tried loading it in another program to check?

Share this post

Link to post
Share on other sites

I used Gimp for the creation of the alpha channel.


Also I tried changing the order, putting glBlenFunc before (which makes total sense btw) and no change.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this