Performance questions re: Capsules & GeneralConvexPairTester
Posted: Mon Mar 12, 2012 9:36 am
Hello again,
I've been working through some performance issues I'm having with CompoundBody objects composed of between 3 and 7 capsules that are interacting with the terrain. The context is that of a character or other object that has been destroyed and various parts are hitting the world as they bounce around. Performance hasn't been good enough and so I tried simply creating spheres where the capsules were supposed to be and used the capsules radius. By doing this, the performance problem was virtually eliminated but of course the behavior was not that of capsules hitting the world. For example, the frame time without any rigid bodies is about 5ms, with 7 compound rigid bodies using spheres instead of capsules about 6ms, and with 7 compound rigid bodies using capsules around 45ms - obviously a pretty steep cost for capsules. Until I looked at this closely in the profiler I was pretty sure that I was doing something to cause the framerate to drop so badly, but after the sphere test and seeing the numbers come out of GeneralConvexPairTester I'm starting to realize there's not much I can do about the performance problem so long as I use capsules. I'm inclined to use a row of spheres to represent capsules to see how well that performs. I would appreciate any suggestions on what else I can do to improve performance here.
I'm curious if there are any plans for the creation of optimized testing functions for capsules? My immediate need is capsule to box, but given that capsules are one of the more generally useful & efficient primitives it would be great to have optimized support for capsules against sphere/box/triangle/convex. I'd expect contact generation costs for capsules to be around 2 or 3x that of a sphere if these were available (== orders of magnitude less of what it is now). I know that would be a lot of work and I don't really expect it to happen any time soon if ever, so I was looking at Bullet to see if maybe I could port something over myself. I found this, but oddly it doesn't seem to have made it into the trunk there, not sure why. I'm only passingly familiar with Bullet's code and conventions and after a closer look I decided porting those functions is more than I want to take on right now but maybe this will plant the seed for someone more industrious than myself
Thanks again for Bepu, this is a great API and I've enjoyed learning more about it lately.
I've been working through some performance issues I'm having with CompoundBody objects composed of between 3 and 7 capsules that are interacting with the terrain. The context is that of a character or other object that has been destroyed and various parts are hitting the world as they bounce around. Performance hasn't been good enough and so I tried simply creating spheres where the capsules were supposed to be and used the capsules radius. By doing this, the performance problem was virtually eliminated but of course the behavior was not that of capsules hitting the world. For example, the frame time without any rigid bodies is about 5ms, with 7 compound rigid bodies using spheres instead of capsules about 6ms, and with 7 compound rigid bodies using capsules around 45ms - obviously a pretty steep cost for capsules. Until I looked at this closely in the profiler I was pretty sure that I was doing something to cause the framerate to drop so badly, but after the sphere test and seeing the numbers come out of GeneralConvexPairTester I'm starting to realize there's not much I can do about the performance problem so long as I use capsules. I'm inclined to use a row of spheres to represent capsules to see how well that performs. I would appreciate any suggestions on what else I can do to improve performance here.
I'm curious if there are any plans for the creation of optimized testing functions for capsules? My immediate need is capsule to box, but given that capsules are one of the more generally useful & efficient primitives it would be great to have optimized support for capsules against sphere/box/triangle/convex. I'd expect contact generation costs for capsules to be around 2 or 3x that of a sphere if these were available (== orders of magnitude less of what it is now). I know that would be a lot of work and I don't really expect it to happen any time soon if ever, so I was looking at Bullet to see if maybe I could port something over myself. I found this, but oddly it doesn't seem to have made it into the trunk there, not sure why. I'm only passingly familiar with Bullet's code and conventions and after a closer look I decided porting those functions is more than I want to take on right now but maybe this will plant the seed for someone more industrious than myself

Thanks again for Bepu, this is a great API and I've enjoyed learning more about it lately.