Archived

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

brianhj

GLUT / alpha blending / texture question

Recommended Posts

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites