Hi,
currently i use a sphere primitive shape for convex casts. This works very fine, but its often too slow for my game.
Are there any guidelines or tips to improve performance for convex casts? I don't exactly need a sphere cast, just some volume.
What shape for best convex cast performance?
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: What shape for best convex cast performance?
It is likely not the btSphereShape primitive that impacts performance, but all the other objects.
Can you share a sample of your world objects? Would it be possible to share it using the Collada exporter, so we can do some performance benchmarks?
Thanks,
Erwin
By the way, we started a IRC #bulletphysics discussion channel on freenode.net server
Can you share a sample of your world objects? Would it be possible to share it using the Collada exporter, so we can do some performance benchmarks?
Thanks,
Erwin
By the way, we started a IRC #bulletphysics discussion channel on freenode.net server
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: What shape for best convex cast performance?
Hi Erwin,Erwin Coumans wrote:It is likely not the btSphereShape primitive that impacts performance, but all the other objects.
Can you share a sample of your world objects? Would it be possible to share it using the Collada exporter, so we can do some performance benchmarks?
Thanks,
Erwin
By the way, we started a IRC #bulletphysics discussion channel on freenode.net server
i use the sphere cast to detect camera obstrusion. When using a single ray the performance is almost not countable. When using a convex cast it takes 6-8% on the Wii. I guess the AABB area within the cast has around 300 AABBs on peak.
So it doesn't matter if a sphere is tested or let say a swept triangle?
In this special case I could even get away with no exact collision data, but just that a collision happended. I guess this could speed things alot. Is there a way to test just for a collision without further costly evaluations?
I will take a look if i can get collision data for you.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: What shape for best convex cast performance?
Code: Select all
When using a single ray the performance is almost not countable. When using a convex cast it takes 6-8% on the Wii.
Code: Select all
void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
RayResultCallback& resultCallback)
{
btSphereShape pointShape(btScalar(0.0));
pointShape.setMargin(0.f);
const btConvexShape* castShape = &pointShape;
The btSphereShape has the best performance for the btCollisionWorld::convexSweepTest, it should be faster than casting a btTriangleShape.
Thanks,
Erwin
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: What shape for best convex cast performance?
Hi,
thanks for the infos. For curiosity i tested it also with a box and cpu usage nearly doubled.
I think the main problem are the missing boradphase optmizations. When you added them for the rayTests the performance increase was dramatic.
Then i have to wait for those optimizations and disable sweep tests for now.
thanks
thanks for the infos. For curiosity i tested it also with a box and cpu usage nearly doubled.
I think the main problem are the missing boradphase optmizations. When you added them for the rayTests the performance increase was dramatic.
Then i have to wait for those optimizations and disable sweep tests for now.
thanks
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: What shape for best convex cast performance?
Both ray cast and convex cast are using the broadphase acceleration structure now:
http://code.google.com/p/bullet/issues/detail?id=144
Please let us know if you notice some performance improvements for the btCollisionWorld::convexSweepTest on Wii,
Thanks,
Erwin
http://code.google.com/p/bullet/issues/detail?id=144
Please let us know if you notice some performance improvements for the btCollisionWorld::convexSweepTest on Wii,
Thanks,
Erwin