glBlendFunc( GL_ONE, GL_ZERO ); glEnable( GL_ALPHA_TEST ); glAlphaFunc( GL_GREATER, 0.75 ); ...draw foliage...Now redraw your foliage using alpha-blending but with a low alpha-test cut-off, depth-writes turned off, and depth testing set to less-than:
glAlphaFunc( GL_GREATER, 8.0 / 255.0 ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glDepthMask( GL_FALSE ); glDepthFunc( GL_LESS ); ...draw foliage again... glDisable( GL_ALPHA_TEST ); glDepthMask( GL_TRUE ); glDepthFunc( GL_LEQUAL );As you can see there is the cost of drawing all your foliage twice, but I think the image quality makes it worth it. You don't need to disable depth writing after each tree - draw all your organic foliage using the alpha-testing pass, then do it all again with the alpha-blending pass. Here's another comparison shot using a pine-tree (alpha-blended, alpha-tested, both): Static screenshots don't really do it justice. It looks nicer in motion. Anyway, hope that helps someone as it sure helped me. Apologies if this is a known trick. If that's the case, I figure there are some who don't know it.