GLUT / alpha blending / texture question

Started by
6 comments, last by brianhj 22 years, 8 months ago
I have two textures, the first has an alpha channel, and the second one doesn''t. In PSP7, I saved the black part (by selecting it with the magic wand) of the TGA to the alpha channel. In my program, I draw the first quad in the background, and map the second texture to it. I draw another quad in front of it, and map the alpha channel texture to it. I want the black part of the alpha channel texture to be invisible. What am I doing wrong? Screenshot: http://home.houston.rr.com/bjohnston2/texture.jpg Code: http://home.houston.rr.com/bjohnston2/glutfps.cpp Thanks, B
Advertisement
the code looks right...

are you sure the image has alpha values in it?
Here''s a screenshoot of my texture in Photoshop, with alpha channel:

http://home.houston.rr.com/bjohnston2/ps.jpg


B
The problem with your program lies with the initilization of the variables. The computer thinks that the alpha paramater is not used, but it is which causes an overloaded in memory for the graphic. This causes the computer to throw out a random "garbage" for output, which results in the garble. To fix this problem you must do some low level programming on your own (video card) to fix it.

Asmodean00

I''''m a coder who sucks.
I''m a coder who sucks.
Josh, shut the hell up.

(He''s a real-life friend of mine.)

B
I just did a quick check on your code but it looks like you are storing the texture with RGB as internal format. This is also something that should be done with alpha testing.
Where am I storing the texture in RGB format? I put GL_RGBA...
Obelix: thanks, I found the problem.

Woot!

B

This topic is closed to new replies.

Advertisement