Textures with alpha channel concerns

I recently got textures drawing with an alpha channel.

Right now it seems that I still have to enable blending before I draw any of these textures, and draw them in the correct order…

I was hoping not to have to do either of these things. Is there a way, if the alpha value is either none or all, to avoid it?

I’ve seen things like this in games where tree foliage is mapped like this around cylindrical shapes and whatnot, and it looks good from all angles (of course). This is the sort of thing I would like to do - just mask out a certain portion of the pixels without a double pass.

Any ideas?


There is an alpha test in the pipeline. I think if you say

glAlphaFunc(GL_GREATER, 0.5);

then all fragments with an alpha greater than 0.5 will be drawn, all others will be culled. You don’t get the nice anti-aliased look that you can get with blending, though. Maybe using a combination of the two would be best.

(EDIT) I think you need to glEnable(GL_ALPHA_TEST);


[This message has been edited by j (edited 01-15-2001).]

Nothing has ever worked so quickly and easily for me before. That definitely did the trick.

Thanks j!