My program involves drawing textures with transparency - for the branches of a tree, for example, I have a texture of the tree with the gaps between the branches made clear by setting the texture’s alpha channel to 0 there.
The problem is that opengl updates the depth buffer even where the texture is clear - so objects that are drawn afterwards and behind the tree are not visible in the gaps between the branches.
This also affects the drawing of clouds, etc… and it would be too expensive in frame rate to fix it with more geometry.
I’ve tried to use glAlphaFunc(GL_GREATER,0.05); to stop drawing of pixels with high transparency, but the depth buffer is still updated there…
I know I can solve this by depth sorting the objects I draw, but I’d like to avoid that if possible - it’d (again) be too much of a speed loss to depth sort 3000 trees…
Thanks in advance,