Ok, I have 80,000 "Box" Mesh with simple textures I have set a view distance and only draw the ones you can see which leave 600 to 1000 for the DrawModel function belowe The problume is I only get 10 frame per second and my view distance is crappy Also, I have done memory test to all my code and the "mesh.draw()" takes 30 Frame per second off. nothing else take NEAR that much. Any help?
private void DrawModel(MeshHolder tmpMH)
{
Model tmpDrawModel = (Model)_Meshs[tmpMH.MeshFileName];
Matrix[] transforms = new Matrix[tmpDrawModel.Bones.Count];
tmpDrawModel.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in tmpDrawModel.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.LightingEnabled = false;
effect.TextureEnabled = true;
effect.Texture = (Texture2D)_Textures[tmpMH.GetTexture(Count)];
effect.View = _MainCam.View;
effect.Projection = _projection;
effect.World =
transforms[mesh.ParentBone.Index] *
Matrix.CreateFromYawPitchRoll(tmpMH.Rotation.Y, tmpMH.Rotation.X, tmpMH.Rotation.Z) *
Matrix.CreateScale(tmpMH.Scale) *
Matrix.CreateTranslation(tmpMH.Position);
}
mesh.Draw();
}
}