Advertisement

Strange problems with TGA files

Started by July 11, 2008 09:25 PM
2 comments, last by brandonman 16 years, 6 months ago
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.
Have you tried not compressing them?
-------------------------Only a fool claims himself an expert
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.
OK, I found a GL_RGB which should have been GL_RGBA, and then did this:
glEnable(GL_ALPHA_TEST); //Enable alpha-blendingglAlphaFunc(GL_GREATER, 0.5f); //drawglDisable(GL_ALPHA_TEST);

It now works.

This topic is closed to new replies.

Advertisement