Multiple scenes in Bullet

shinzironine
Posts: 3
Joined: Thu Jan 16, 2014 9:53 am

Multiple scenes in Bullet

Post by shinzironine »

We are currently working on serverside physics for an action game and considering to use Bullet engine for server-side simulation.
For our game each server should handle a big number of simultaneous simulation of small scenes (separate battles). We tried to achieve this with Bullet 3.X because of its GPU-optimized rigidbody pipeline and created a single scene with a lot of rigid bodies, which seemed to work fast and efficient. On the other hand, when we have created even a second scene, we've witnessed a substantial drop in performance.
We are creating a single cl_context for all scenes and separate b3GpuRigidBodyPipeline (with np and bp) for each scene. Is this a correct approach?
Does Bullet 3.X support simulation of multiple scenes currently, or will it be supported in the future? Or is it possible to efficiently simulate physics using GPU on Bullet 2 with GPU rigid body pipeline?
Maybe we could just position objects from all scenes on one big scene, and separate them with some kind of walls? It sounds like a plausible idea, but somewhat crappy.
Thank you!
shinzironine
Posts: 3
Joined: Thu Jan 16, 2014 9:53 am

Re: Multiple scenes in Bullet

Post by shinzironine »

Out of the box the engine gave somewhat slow results even on two empty scenes. After reducing variables in b3Config we managed to reduce work of the engine to 10ms/per frame/per scene, each with 100 rigidbodies. But it seems like Bullet can be even faster. After some profiling it looks like much of that 10ms time goes to calls of clFinish, at that time GPU is idle. Is there any way to improve performance? What if we just swap calls of clFinish to clFlush, will it improve performance?
Thanks!