I know the following is a vague question, but I am facing performance issues that I did not expect in XNA.
I have a low poly model (it has 18 faces and 14 vertices), which I try to draw on the screen (large!) A number of times. I get over 60 FPS (in a decent car) until I draw this model 5000+ times. Am I asking too much? I would very much like to double or triple this number (10-15 thousand), At least.
My code for actually drawing models is below. I tried to eliminate as many calculations from the pull cycle as possible as quickly as possible, can I still compress from it, or is it better to work together?
Note: tile.Offset is evaluated once during initialization, and not in each cycle.
foreach (var tile in Tiles) { var myModel = tile.Model; Matrix[] transforms = new Matrix[myModel.Bones.Count]; myModel.CopyAbsoluteBoneTransformsTo(transforms); foreach (ModelMesh mesh in myModel.Meshes) { foreach (BasicEffect effect in mesh.Effects) {
source share