Zoulz

Is it a good idea to use multiple SpriteBatch objects to render different batches of sprites (GUI elements, additive particles, animated sprites etc), or can I just pass around one instance of a SpriteBatch and Begin/End for each different batch



Re: XNA Game Studio Express Multiple sprite batches?

Bill Reiss

It's better, if possible to use one sprite batch. The amount of sprite batch start and end calls will be one of the biggest performance impacts in your 2D game. The next big performance tip is to use as few Texture2Ds as possible, and if you have multiple sprites coming from the same Texture2D, draw all those sprites in sequence then move on to your next texture since each time you switch the texture you are drawing from there is significant overhead. Ideally you would have all of your sprite graphics in a single texture, but at least limit it if possible.

Bill






Re: XNA Game Studio Express Multiple sprite batches?

Bill Reiss

Oh and I forgot to mention...limit your textures to a maximum size of 2048x2048. Anything larger than this will not work on some graphics adapters.