I am trying to simulate realistic effects like spark using particles, that need to z-layer properly with other objects in the scene.
I am looking into using a particle system that consists of a mesh where each vertex is particle. I believe this would allow simulating the particles on the GPU by using a vertex shader.
I am running into issues with the particle not being rendered with the right depth; i.e. some particles appear "behind" or "in front of" other objects when they shouldn't be.
Additionally, this would never allow the particles to interact with other objects in the scene.
Should I consider instead, simulating each particle as its own sprite object in the scene, and manipulate the physics using CPU code? Or is there another way to solve the issues with my GPU particles?