Hello.
Currently i am trying to design multy level height.
So i have a map that has 4 layers,(Floor,low,middle,high), i am not doing base layer for ground i am making objects, and i want them to be able to stack one up on other.
So if i made one vertex for each 320x320 pixel region, my issue is that whenever i add object, i don't want to reposition the whole vertex array if it is bellow another object.
If i add object to position x=0,y=0, with size w=32,h=32 at layer middle. vertexArray(VA) position will be 0-3
Now when i add another object at same position, but at layer floor VA(4-7), i need to switch those around so i will draw in correct order.
That is not issue on small scale, but i am not in small scale, and repositioning hundred vertices, for only one object is passable, but in case 10 objects tumbles from middle layer to low...
So if i make one vertexArray for each layer, i can just add intro it without any checks because objects cannot overlap, problem is that i do not know how to link the VertexArrays together for faster drawing or is it even possible, they will use same texture and renderStates.
I don't know a way to make this efficient atm.
Any suggestions would be gladly appreciated.
The point is to add and remove objects at runtime, and have them show per layer,(Draw order, floor->low->middle->high)) So if at one position we would have, (Candle-Floor, chair-low, bread-middle)
i would see chair with bread on it, no candle what so ever, and because i don't want to have over hundred of vertexArray draw calls i am asking for help.