Jump to content

  • Log In with Google      Sign In   
  • Create Account

GLUT / alpha blending / texture question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 brianhj   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 August 2001 - 10:25 AM

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

Sponsor:

#2 core114   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 August 2001 - 02:42 PM

the code looks right...

are you sure the image has alpha values in it?

#3 brianhj   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 August 2001 - 03:52 PM

Here''s a screenshoot of my texture in Photoshop, with alpha channel:

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


B

#4 Asmodean00   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2001 - 04:17 PM

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.

#5 brianhj   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2001 - 04:35 PM

Josh, shut the hell up.

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

B

#6 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2001 - 10:59 PM

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.

#7 brianhj   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 August 2001 - 06:23 AM

Where am I storing the texture in RGB format? I put GL_RGBA...

#8 brianhj   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 August 2001 - 07:10 PM

Obelix: thanks, I found the problem.

Woot!

B




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS