In an hexgrid based game, I render all terrain tiles as a separate model, reusing the same texture objects on all similar tiles. The tiles is a pretty simple model.
When the terrain is set to be at 20x20 or more (so 400 tiles), the game really slows down. The "slowdown point" is about the same on my i5 laptop or my i7 desktop. The game takes around 30megs in the memory. Here is how the render looks like :
The way I render each tile is the following :
foreach (ModelMesh mesh in ModelSupport.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[mesh.ParentBone.Index]
* mScale * mRotationY * mPosition;
effect.View = Camera.ViewMatrix;
effect.Projection = Camera.ProjectionMatrix;
}
mesh.Draw();
}
Any suggestion of how I could optimize the rendering of a large amount of models?