views:

39

answers:

1

My scene has a number of stacks of dynamic objects. When the simulation starts, it takes a while for these to "resolve" before they become sleeping islands. This affects performance significantly for the first few seconds.

Are there techniques for arranging stacks so that they immediately sleep?

I'm using PhysX.

A: 

I'm not familiar with PhysX, but I can make some educated guesses about how it works. Here are one or two ideas that may or may not work depending on, e.g., how PhysX decides to declare an object "resolved":

If the blocks are actually moving, it's probably because there's some imprecision in their initial location, which gives them room to settle. Maybe there's a way to reduce that imprecision, for instance by saving a resolved configuration instead of relying on one designed on paper. Since they eventually stop, there must be a dissipative force at work (e.g. friction), and it must have a parameter. So turn it up high at first, as if the blocks are immersed in honey, then dial it down.

Whether or not they're actually moving, a block at the top of a big jittery tower of blocks can't possibly settle down until all the blocks below it have done so, so all the calculation to simulate its jiggling is completely wasted-- to say nothing of how its uncertainty may disturb the blocks below. So try being a bricklayer, placing the bottom objects first, letting them resolve, then working your way up (in "courses", as they say).

If you can't eliminate it, cover it up; maybe you can hide the blocks for the first few seconds, then raise the curtain once they're resolved. This doesn't make things faster but it might make things more presentable.

Beta