[lwjgl] Multi-layer (3+) blending in 2-d (separate VBOs)

Does anyone know how to make blend more than 2 textures? It seems that OpenGL only is blending the top and bottom image with. I’m currently using:


            
            glShadeModel(GL_SMOOTH);
            glEnable(GL_BLEND);
            glEnable(GL_TEXTURE_2D);            
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
            

And it looks good as long as I have just one sprite against the back ground, but if two overlap one is not fully drawn or gets overwritten in an ugly way, making a square whole where the top model is:

I’ve seen games based on LibGDX that seemed to have fixed this somehow, and have an idea how it could be done in Java2D, but don’t want to re-write my rendering if I don’t have to. Solutions I find by Google are not only fairly complex but assume a 3D scene and all the texture being on the same model, so not really aplicable. I had wondered if there was a way to render to the buffer without a full Display.update() call so they might be blended with existing graphics, but don’t see any way of doing that?

Any suggestions?

Maybe you have depth testing enabled. Try disabling it, that’s not necessary for 2D games.


glDisable(GL_DEPTH_TEST);

Thanks, I did in fact have the depth test explicitly enabled (and z values set to put entities in front of the world); I changed it too disabled, and everything works the same (draw order still keeps entities visible). Unfortunately, this didn’t make a difference in the problem either (I don’t know if other hardware or drivers would help); still the same old overlapping.