I currently have a 2D, tile-based rendering system which uses a texture atlas to draw textured quads (simple sprites). The quads are z-ordered, as is common in such systems, so that a tall entity will render on top of entities that are higher up in the scene (e.g. a character walking behind a tree). Once the entities are ordered and vertices calculated, I draw everything in a single draw call, using glDrawArrays:
glDrawArrays(GL_TRIANGLES, 0, buffer_size);
Now I am trying to implement a particle system that will use another draw call, this time with GL_POINTS, to render the particles. I am wondering how I can render the particles in a way that will obey the z-order of my sprites, even though the sprites and particles have separate draw calls. For example, if a character is standing behind a tree and emits blood particles, I would like the blood particles to also render behind the tree.
The only conceivable way I've come up with would be to completely break up the rendering of my sprites, and render each one separately, so that the particles can be drawn along with them at the correct z-order. This will greatly increase the number of draw calls, so I'm wondering if there is a better method that I'm not aware of.
As an addendum: I'm aware that draw calls are not a huge issue for very simple 2D applications, but this particular program will employ quite a few shader effects and some CPU intensive computations, so I do need to be as performant as possible.