glBlendFunc

Started by
1 comment, last by gus 22 years, 5 months ago
How do I set glBlendFunc if I want a polygon to be completely visible if alpha = 1.0 and completely transparent if alpha = 0.0 ? thanks
Advertisement
The "common" setting for glBlendFunc() is

glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );

You then have to render the polygons from back to front.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
You can almost do that using alpha testing:
  gEnable(GL_ALPHA_TEST);glAlphaFunc(GL_GREATER,0.0f);// RenderglDisable(GL_ALPHA_TEST);  


[Resist Windows XP''s Invasive Production Activation Technology!]

This topic is closed to new replies.

Advertisement