Jump to content
  • Advertisement
Sign in to follow this  

Strange problems with TGA files

This topic is 3598 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

Hey. I just went through my current code, and set it up to load TGA's, and changed all of my BMP's to TGA's, setting the black in each one to alpha with the "magic wand" in Paint.net by deleting the black area, leaving transparency. I saved the images as RLE compressed, 32 bit TGA's, but I get very strange problems when I load them. I know it is not my code, since the tga's that came with the nehe lesson load just fine. Here is what I am getting: Image Hosted by ImageShack.us<br/> Any thoughts? I don't have photoshop, but I have also tried this in GIMP, to no avail.

Share this post


Link to post
Share on other sites
Advertisement
Tried that, but it didn't work. I got this working, was using GL_RGB, should have been GL_RGBA. Now I don't have transparency, but white backgrounds... I'm going to work on this and see what I get.

Share this post


Link to post
Share on other sites
OK, I found a GL_RGB which should have been GL_RGBA, and then did this:

glEnable(GL_ALPHA_TEST); //Enable alpha-blending
glAlphaFunc(GL_GREATER, 0.5f);
//draw
glDisable(GL_ALPHA_TEST);


It now works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!