# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: [solved] scale world 100x -> performance increase 3xPosted: Thu Sep 07, 2017 11:34 am

Joined: Wed Mar 16, 2016 10:11 am
Posts: 59
It is surprising that just scale every thing make so much difference in performance.

First Experiment
I created a scene with 1,000 cubes.
Cube's size = 0.01f
They scattered around a plane size = 5*5 (w*h)
I got 20fps.
The profile result states that Bullet Physics is the bottleneck.

Second Experiment
1,000 cubes
size = 1.0f
They scattered around a plane size = 500*500
I got >> 60fps.

The cause (my guess)
It must be Bullet's boardphase aabb culling.
In the first experiment, many cubes probably fall into the same slot of boardphase's grid.

Question
Are there any way to guide Bullet's boardphase about my world scale?

I have read :-
boardphase : http://www.bulletphysics.org/mediawiki- ... Broadphase
btDbvtBroadphase : http://www.bulletphysics.org/mediawiki- ... _aabb_tree
scale the world (unrelated) : http://www.bulletphysics.org/mediawiki- ... _The_World

Edit: No one answer.
I doubt that I didn't do research enough / my question is unclear, too easy, not interesting /
or no one know the answer?

Edit2: I am very satisfied with drleviathan's answer, so I marked it as solved for now. Thank!

Last edited by hyyou on Sat Sep 16, 2017 2:03 am, edited 1 time in total.

Top

 Posted: Fri Sep 15, 2017 9:37 pm

Joined: Tue Sep 30, 2014 6:03 pm
Posts: 363
Location: San Francisco
My guess is that the "collision margin" feature on the shapes expands their bounding box. If you aren't setting the collision margin manually then you're using the default margin (which is 0.04m!). Meanwhile, it appears that the broadphase data structure also has a hard coded default margin (look for DBVT_BP_MARGIN in the codebase -- I assume you're using the btDbvtBroadphase class) which is 0.05m. In short, the aabb of each object is larger than you think, and in the tiny-case it is relatively much larger than the large-case. More overlaps means more narrowphase evaluations means more CPU costs.

Top

 Posted: Sat Sep 16, 2017 2:01 am

Joined: Wed Mar 16, 2016 10:11 am
Posts: 59
Thank drleviathan. This is a very reasonable guess.

Top

 Posted: Mon Sep 18, 2017 8:30 pm

Joined: Fri May 06, 2016 9:18 pm
Posts: 2
IIRC, there is also a contact processing threshold that further expands the bounding boxes by a small amount

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 24 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities