diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-05-04 02:29:00 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-05-04 02:29:00 +0400 |
commit | 3abb8e8e68c824db7cecdf2360e8e1daaff00413 (patch) | |
tree | 8f4fea6f267ce2d268cb82e9121c5208eeea8d8a /source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp | |
parent | 2aa3c932d00977a70bc299bd709fa505c48518d8 (diff) |
BGE performance: second round of scenegraph improvement.
Use dynamic linked list to handle scenegraph rather than dumb scan
of the whole tree. The performance improvement depends on the fraction
of moving objects. If most objects are static, the speed up is
considerable. The following table compares the time spent on
scenegraph before and after this commit on a scene with 10000 objects
in various configuratons:
Scenegraph time (ms) Before After
(includes culling)
All objects static, 8.8 1.7
all visible but small fraction
in the view frustrum
All objects static, 7,5 0.01
all invisible.
All objects moving, 14.1 8.4
all visible but small fraction
in the view frustrum
This tables shows that static and invisible objects take no CPU at all
for scenegraph and culling. In the general case, this commit will
speed up the scenegraph between 2x and 5x. Compared to 2.48a, it should
be between 4x and 10x faster. Further speed up is possible by making
the scenegraph cache-friendly.
Next round of performance improvement will be on the rasterizer: use
the same dynamic linked list technique for the mesh slots.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp index 0e7571031e8..cb933419c57 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp @@ -125,7 +125,9 @@ UpdateChildCoordinates( else { child->SetWorldFromLocalTransform(); } - child->SetModified(false); + child->ClearModified(); + // this node must always be updated, so reschedule it for next time + child->ActivateRecheduleUpdateCallback(); return valid_parent_transform; } |