BGE Scenegraph and View frustrum culling improvement.
authorBenoit Bolsee <benoit.bolsee@online.be>
Tue, 7 Apr 2009 22:14:06 +0000 (22:14 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Tue, 7 Apr 2009 22:14:06 +0000 (22:14 +0000)
commit51b4145841293d4a695b7bbe88e90ebd98443fc8
tree61818fb3a50e0891b630680b203c3fe80fe149bb
parent486985762aa71b75ec1d1d0e7bbf0f777065f3a3
BGE Scenegraph and View frustrum culling improvement.

This commit contains a number of performance improvements for the
BGE in the Scenegraph (parent relation between objects in the
scene) and view frustrum culling.

The scenegraph improvement consists in avoiding position update
if the object has not moved since last update and the removal
of redundant updates and synchronization with the physics engine.

The view frustrum culling improvement consists in using the DBVT
broadphase facility of Bullet to build a tree of graphical objects
in the scene. The elements of the tree are Aabb boxes (Aligned
Axis Bounding Boxes) enclosing the objects. This provides good
precision in closed and opened scenes. This new culling system
is enabled by default but just in case, it can be disabled with
a button in the World settings. There is no do_version in this
commit but it will be added before the 2.49 release. For now you
must manually enable the DBVT culling option in World settings
when you open an old file.

The above improvements speed up scenegraph and culling up to 5x.
However, this performance improvement is only visible when
you have hundreds or thousands of objects.

The main interest of the DBVT tree is to allow easy occlusion
culling and automatic LOD system. This will be the object of further
improvements.
54 files changed:
extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Physics.vcproj
source/blender/blenkernel/intern/world.c
source/blender/makesdna/DNA_world_types.h
source/blender/src/buttons_shading.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
source/gameengine/Ketsji/KX_Camera.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MotionState.cpp
source/gameengine/Ketsji/KX_MotionState.h
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp
source/gameengine/Ketsji/KX_SG_NodeRelationships.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
source/gameengine/Physics/Bullet/CcdGraphicController.cpp [new file with mode: 0644]
source/gameengine/Physics/Bullet/CcdGraphicController.h [new file with mode: 0644]
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
source/gameengine/Physics/common/PHY_DynamicTypes.h
source/gameengine/Physics/common/PHY_IController.cpp [new file with mode: 0644]
source/gameengine/Physics/common/PHY_IController.h [new file with mode: 0644]
source/gameengine/Physics/common/PHY_IGraphicController.cpp [new file with mode: 0644]
source/gameengine/Physics/common/PHY_IGraphicController.h [new file with mode: 0644]
source/gameengine/Physics/common/PHY_IMotionState.h
source/gameengine/Physics/common/PHY_IPhysicsController.h
source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
source/gameengine/Rasterizer/RAS_BucketManager.cpp
source/gameengine/Rasterizer/RAS_FramingManager.h
source/gameengine/Rasterizer/RAS_MaterialBucket.h
source/gameengine/SceneGraph/SG_BBox.cpp
source/gameengine/SceneGraph/SG_BBox.h
source/gameengine/SceneGraph/SG_IObject.cpp
source/gameengine/SceneGraph/SG_IObject.h
source/gameengine/SceneGraph/SG_Node.cpp
source/gameengine/SceneGraph/SG_Node.h
source/gameengine/SceneGraph/SG_ParentRelation.h
source/gameengine/SceneGraph/SG_Spatial.cpp
source/gameengine/SceneGraph/SG_Spatial.h