OK、私は単純なテクスチャを持つ 80,000 の「ボックス」メッシュを持っています。表示距離を設定し、下の DrawModel 関数に 600 から 1000 を残す、見えるものだけを描画します。また、すべてのコードに対してメモリ テストを行ったところ、"mesh.draw()" で毎秒 30 フレームがオフになります。それほどNEARを取るものは他にありません。何か助けはありますか?
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();
}
}