PDA

View Full Version : glBlendFunc problem



darkrappey
12-02-2006, 11:59 PM
I understand from many tutorials that GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA is the best blend function.
(which makes perfect sense, 1a-1a = 0a)

Anyway, all blend functions seem to work as their documentation says they should except that one. When I use that one it doesn't use the alpha channel.(replaces it with black)

Is there any common reason for this problem?

This is mainly for particles & HUD elements.

Komat
12-03-2006, 02:24 AM
Originally posted by darkrappey:

Anyway, all blend functions seem to work as their documentation says they should except that one. When I use that one it doesn't use the alpha channel.(replaces it with black)
Are you sure that your shader or texture environment setup generates nonzero alpha? This blending mode is used very often so the driver error is unlikely.

darkrappey
12-03-2006, 05:03 PM
I generate textures in this fashion:



Are you sure that your shader or texture environment setup generates nonzero alpha?
When I use the other blend functions the alpha of texture definitely effects how the particles are rendering (just not in the way I would like it to).

http://img297.imageshack.us/img297/9862/particleslv2.jpg (http://imageshack.us)

darkrappey
12-03-2006, 05:07 PM
I also just enabled fog again and it seems to mess up the alpha buy making it white at a distance... could this be related or a hole other problem?

Komat
12-03-2006, 05:52 PM
In the 32 bit texture variant you are calling the gluBuild2DMipmaps for three components instead of four so the alpha value is lost and replaced with opaque one.

darkrappey
12-03-2006, 06:45 PM
d'Oh, my bad. I didn't even look at the function specification to notice that. Shame on me lol.

Works now as far as I can tell.

-thanks once again Komat