Having worked in a default Java 2D graphics for a good while, I’m used to the concept that the last thing that is rendered goes on top.
I’d like to simulate this similar layering in a 2D OpenGL game.
Up until now, I have been setting z values of the individual objects to decide what gets rendered on top, but this is getting very awkward and impractical especially when adding transparent objects.
I had the idea of just increasing the z value that each object is rendered on as objects are rendered each frame, but I’m using buffer objects that only get generated once and then rendered each frame. Also, the buffer objects have differing z values within them so it becomes difficult to layer them individually.
I realize a lot of this probably doesn’t make any sense but any help would be greatly appreciated