Hello everyone,
I have newbie question. What is the “ideal” usage of SpriteBatches in MonoGame? Currently, each entity displayed in my game has its own SpriteBatch (character, tiles for the environment, etc), but I realized that I just made my life pretty difficult with that if I want the rendering to happen in a specific order (the depth param is ignored because of this).
I have 2 ideas to solve it:
1, Using only 1 spritebatch for everything on my screen, that would make ordering very easy as I can simply pass the depth for the draw command. Not sure about how it would perform though.
2, Using 1 spritebatch for each “layer” in my game (I group my entities into “layers”, like characters, environment, background layers that scroll with different speed, etc), having a priority set to these layers (Draw would be called on the highest priority layer first, then the second…) and just use the depth paramter if I need ordering within a layer (for example if my character overlaps with an enemy).
Which one would be preferable in terms of graphics performance in MonoGame? Having 1 spritebatch for all, or the second approach?
Thank you