I am trying to blend faces in a two pass approach. In the first pass, I only want to render fully opaque pixels with z-buffer writes enabled, and in the second pass, I only want to render non-fully-opaque pixels with z-buffer writes disabled.
So far, so good, if only glAlphaFunc did what I wanted it to do. When I render an RGBA texture that has some fully opaque pixels, some semi-transparent pixels and some fully transparent pixels, then the following combination does what I expect:
When I pass a texture with only fully opaque pixels and combine this with a GlColor command such as GlColor(1.0, 1.0, 1.0, 0.5), all pixels, semi-transparent now due to GlColor, will GET rendered, apparently bypassing GlAlphaFunc, even though I loaded the texture in RGBA mode.
Same for non-textured faces. Here, with GlColor(1.0,1.0,1.0,0.5), even though the face is semi-transparent now, the face DOES get rendered, apparently bypassing the GlAlphaFunc test, too.
Is this how GlAlphaFunc is supposed to work? Should it indeed ignore alpha contributions from GlColor and only work for the alpha inside textures?