Bepu physics wih OpenTK is parinfully show

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
aeroflyluby
Posts: 4
Joined: Thu Jan 29, 2015 7:04 pm

Bepu physics wih OpenTK is parinfully show

Post by aeroflyluby »

Without any dynamic meshes it behaves ok and keeps on 60fps
but when I add just as little as 10 cubes to rool on - the fps drops dramatically like to 6-8 fps.
It seems to stop lagging when objects stop touching themselves, but lags anyway but less.
How it come? I tries various thnings like:
  • - Update in World Drawing - with time and without time parameter
    - Update from another thread - seems a LITTLE faster but introduces weird artifacts like jumping entities
    - Update from enternal thread and set meshes position immidiately - on opengl side - no change
    - Using paraller looper don't change anything
I also tried various hacks like

Code: Select all

            PhysicalWorld = new Space(parallelLooper);
            PhysicalWorld.Solver.AllowMultithreading = true;
            PhysicalWorld.ForceUpdater.Gravity = new Vector3(0, -9.81f, 0);
            SolverSettings.DefaultMinimumIterationCount = 0;
            PhysicalWorld.TimeStepSettings.MaximumTimeStepsPerFrame = 4;
            PhysicalWorld.Solver.IterationLimit = 4;
            GeneralConvexPairTester.UseSimplexCaching = true;
How can it be slow?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bepu physics wih OpenTK is parinfully show

Post by Norbo »

That severe of a performance drop implies some major shenanigans. First, run a profiler or otherwise take measurements to confirm that the problem is actually related to the physics and not some other system.

If the physics appear to be the bottleneck, try replicating the slowdown in the BEPUphysicsDemos, making sure to compile in release mode and run without the debugger attached. If the performance issue exists in the demos, I can take a look and offer more specific advice.

If it isn't reproduced in the demos, it's caused by some external or environmental factor. Incrementally prune out bits of the application to eliminate possible sources of the slowdown.
Post Reply