Unexplainable Framedrop [explainable now]
Posted: Mon Oct 08, 2018 6:08 pm
Hi,
I use BEPUphysics v1 for my FPS-styled game and have a performance issue.
What happens:
I let drop a spaceship on my terrain (2048x2048 vertices). It has a dynamic box-entity. I initialize it with a mass, because I want it to get dropped from the sky. But I get an incredibly framedrop for several seconds at the moment, when the spaceship stops to move. When I move against the spaceship and push it with the character, the FPS drops again (0 - 10 fps until I stop running against the ship). The curios thing about this is, that when I scale my ship down, the framedrops do not occur anymore.
Why does the size of my entity affects the performance so much? Has it too many contact with the terrain-faces?
Here some code how I generate my terrain and the ship entity:
Terrain initialization:
Spaceship initialization:
I add both to the following space:
I update the space without parameters:
Has anyone an idea? Thanks for your help.
EDIT:
If I use the basic cube model (10x size) from blender it works fine. But in both cases I use just a box around my model? So the model should be irrelevant.
I use BEPUphysics v1 for my FPS-styled game and have a performance issue.
What happens:
I let drop a spaceship on my terrain (2048x2048 vertices). It has a dynamic box-entity. I initialize it with a mass, because I want it to get dropped from the sky. But I get an incredibly framedrop for several seconds at the moment, when the spaceship stops to move. When I move against the spaceship and push it with the character, the FPS drops again (0 - 10 fps until I stop running against the ship). The curios thing about this is, that when I scale my ship down, the framedrops do not occur anymore.
Why does the size of my entity affects the performance so much? Has it too many contact with the terrain-faces?
Here some code how I generate my terrain and the ship entity:
Terrain initialization:
Code: Select all
BEPUphysics.BroadPhaseEntries.Terrain terrainBepu = new Terrain(terrain.HeightData, new AffineTransform(new Vector3B(0, 0, 0)));
Code: Select all
spaceShipEntity = new Box(new BEPUutilities.Vector3(camera.position.X, 400, camera.position.Z + 100), boxCoords.X, boxCoords.Y, boxCoords.Z, 1);
Code: Select all
ParallelLooper looper = new ParallelLooper();
for (int i = 0; i < Environment.ProcessorCount; i++)
{
looper.AddThread();
}
space = new Space(looper);
space.ForceUpdater.Gravity = new BEPUutilities.Vector3(0, -9.81f, 0);
Services.AddService(typeof(Space), space);
BepuConfigurationHelper.ApplySuperSpeedySettings(space);
Code: Select all
space.Update();
Has anyone an idea? Thanks for your help.
EDIT:
If I use the basic cube model (10x size) from blender it works fine. But in both cases I use just a box around my model? So the model should be irrelevant.