View Full Version : A problem with blending
12-05-2002, 09:56 PM
It goes like that - I've texturized my shapes but I wanted to make them transparent for objects. I mean the black color shouldn't be drawn because quad-like figures are not the best shape for bitmap ovals. So what is wrong? The quad is transparent all the time - pixels which are not black just change color when some other object fly above them. How to avoid it? (read : I just want to make only black pixels transparent).
PS. Sorry for my english.
12-05-2002, 11:28 PM
glBlendFunc(GL_ONE, GL_ONE) will make black pixels in your object invisible, however all others will be blended..
If you want black ones to be invisible and all others replacing, you can use alpha channel to fill it with say 0 (for black pixels) and 1 (for any other color). Then performing alpha test like glAlphaTest(GL_NOTEQUAL, 0) should work for you.
Also note that if you use blending with alpha testing you need to sort by hand transparent faces before drawing them.
12-06-2002, 08:16 AM
Thanks a lot. I'll check it out!
12-07-2002, 05:12 AM
...? I don't know what's wrong. Meaby I've misunderstood what you've said but I don't have any function like glAlphaTest. Could anybody help me?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.