Using opengl ZBuffer with Libgdx Spritebatch
I'm writing a 2d game engine using libgdx where multiple layers of sprites have to be rendered using SpriteBatch with an OrthgraphicCamera. My layers are sorted with a z component : higher z layers should be rendered on top of layers with a lower z.
Currently, I have to render layers sorted by their z component to achieve that. Is there a way, using opengl Z-buffer, to have them rendered out of order, and still show up correctly ?