Remotion wrote:Hello,
I am experimenting now with Bullet and have some question about it.
For my purpose the real-time is not as important as visual quality.
How to improve quality of the bullet's simulation?
I am also not quite sure how to increase Sub Steps with stepSimulation...
You can decrease the inner timestep to improve accuracy in collision handling. If you pass the real timestep, then make sure maxNumSubSteps is large enough so that stepTime < maxNumSubSteps * internalTimeStep. Otherwise the simulation will drop frames. So you can increase maxNumSubSteps to a very large value. Alternatively just pass '0' to maxNumSubSteps and pass a very small stepTime.
Following 2 examples show a higher accuracy:
Code: Select all
btScalar internalTimeStep = 1.0f/240.0f;
stepSimulation(internalTimeStep, 0);
or alternatively:
Code: Select all
int maxNumSubSteps = 1000;
btScalar internalTimeStep = 1.0f/240.0f;
stepSimulation(stepTime, maxNumSubSteps, internalTimeStep)
Another question is how to arrive deterministic simulation with Bullet?
So the two runs of the same simulation on the same system will get the same results.
Probably the first problem is the btRand2() from equentialImpulseConstraintSolver and static seed...
Yes, first step would be to re-initialize this seed when the simulation starts. I will add this to the todo.
And the last question, how to use Bullet on Multi Core CPU's?
As I know there was some work for Parallel processing for Bullet, is this correct?
Yes, there is an PS3 SPU optimized version that runs collision detection (and solver tasks) in parallel. Some of the changes roll back into the open source verison of Bullet which facilitates SIMD and multi-core optimizations. Some parts in this process are already visible: for example in Bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h, check the new overlapping pair array:
Code: Select all
btAlignedObjectArray<btBroadphasePair> m_overlappingPairArray;
This btAlignedObjectArray replaces the stl::set, and can be easier processed in parallel by multi-core cpu's. You can expect to see some progress towards multi-core optimizations for Bullet.
Thanks,
Erwin