lianlab / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Enhancements #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Based on recent tests on a small test case here is a list of things that
would make Bullet a lot better. Above all I need to point out that the test
app only uses one concave trimesh (btBvhTriangleMeshShape) and two animated
convex trimeshes.

First point is that there are a LOT of supporting vertex queries per update
step (24 frames -> 4282 queries, courtesy of valgrind, and that's only for
the convex meshes) so there is probably room for more optimization.

A good place to start with is to make use of batched queries. Then opening
up the API a bit, as suggested below may allow advanced users to further
optimize the vertex queries by removing most of the overhead induced by the
current design. For instance my test app showed a consistent FPS rise when
I applied the proposed patch and used a custom subclass of
btConvexTriangleMeshShape : +100% compared to simply reimplementing
btStridingMeshInterface::InternalProcessAllTriangles() and +200% compared
to just reimplementing
btStridingMeshInterface::getLockedReadOnlyIndexVertexBase().

Proposed enhancement to convex trimeshes (attached patch) :

 * make btPolyhedralConvexShape use batched supporting vertex queries in
aabb computation (mesh data traversal overhead reduced by a factor 6)
 * additional boolean parameter to btConvexTriangleMeshShape to control
whether the ctor tries to compute local aabb (required for proper
subclassing otherwise segfaults occurs...)

Another useful improvement, a little more tedious a "vast" so no patch
supplied :
 * make GJK solver use batched supporting vertex queries (most of the time
two subsequent queries are for a vector and its opposite so a bit of
refactoring could reduce mesh data traversal overhead by a factor two)

regards

p.c : patch against SVN HEAD i.e r1211

Original issue reported on code.google.com by fullmeta...@hotmail.fr on 27 Jul 2008 at 11:31

Attachments:

GoogleCodeExporter commented 9 years ago

Thanks for the patch, it sounds reasonable. We are in preparation for SIGGRAPH, 
so 
expect some delay.

Original comment by erwin.coumans on 6 Aug 2008 at 4:53

GoogleCodeExporter commented 9 years ago
patch has been applied, thanks for the contribution!

Original comment by erwin.coumans on 29 Aug 2008 at 5:31