[solved] scale world 100x -> performance increase 3x
Posted: Thu Sep 07, 2017 11:34 am
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!
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!