Alpha channels on the fly

Started by
10 comments, last by NotTaxes 22 years, 8 months ago
Well, once you have blended the 2 textures, then just do an Alpha test to discard the pixels that have a 0 Alpha. I dont know how to do it in D3D, but in Opengl:
glAlphaFunc(GL_NOTEQUAL, 0);glEnable(GL_ALPHA_TEST); 


That should discard any pixel with an alpha value of 0.

Hope that helps.

Waramp.
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.
Advertisement
hmmm.... the trouble is that the theory is sound, but the practice is not.

What about using ColorAdd, but having 0,0,0 as the color arguments on the first texture (i.e., only an alpha channel). Then, if you add

0,0,0,150 (from the first texture)

to

100,100,100,0 (from the actual texture)

you should get

100,100,100,150

or, in other words, a grey, half-transparent pixel

Any ideas?

''Doing the impossible is kind of fun'' - Walt Disney
'Doing the impossible is kind of fun' - Walt Disney

This topic is closed to new replies.

Advertisement