Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-05-12 23:48:18 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-05-12 23:48:18 +0400
commit5a0de728b0a6a4b916f88554322cc56884f17ad8 (patch)
tree1ddaa69c4035f060a71cd0487fd121763bf2a75d /source/gameengine/Converter
parent705764fe050fd15703fe2ab410516ff3ccc3f421 (diff)
BGE performance: allow to create display list on meshes with modifiers but without armature and shape keys. These modified meshes are static and can be put safely in a display list. As the rendering of modifiers is done in direct openGL call, it results is a bit performance boost.
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h2
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.cpp6
-rw-r--r--source/gameengine/Converter/BL_SkinDeformer.cpp3
3 files changed, 7 insertions, 4 deletions
diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h
index d1754618df2..11ca3b00a1d 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.h
+++ b/source/gameengine/Converter/BL_MeshDeformer.h
@@ -66,7 +66,7 @@ public:
virtual bool Update(void){ return false; };
virtual bool UpdateBuckets(void){ return false; };
virtual RAS_Deformer* GetReplica(){return NULL;};
- virtual void ProcessReplica() { };
+ virtual void ProcessReplica() {m_bDynamic=false;};
struct Mesh* GetMesh() { return m_bmesh; };
// virtual void InitDeform(double time){};
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp
index bf5eb5cbcb3..e04d4dad015 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.cpp
+++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp
@@ -121,7 +121,7 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void)
ForceUpdate();
m_armobj->RestorePose();
-
+ m_bDynamic = true;
return true;
}
return false;
@@ -144,8 +144,10 @@ bool BL_ShapeDeformer::Update(void)
/* we will blend the key directly in mvert array: it is used by armature as the start position */
/* m_bmesh->key can be NULL in case of Modifier deformer */
- if (m_bmesh->key)
+ if (m_bmesh->key) {
do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0);
+ m_bDynamic = true;
+ }
// Don't release the weight array as in Blender, it will most likely be reusable on next frame
// The weight array are ultimately deleted when the skin mesh is destroyed
diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp
index d40776a645d..e92c3b29543 100644
--- a/source/gameengine/Converter/BL_SkinDeformer.cpp
+++ b/source/gameengine/Converter/BL_SkinDeformer.cpp
@@ -201,7 +201,8 @@ bool BL_SkinDeformer::Update(void)
m_lastArmaUpdate=m_armobj->GetLastFrame();
m_armobj->RestorePose();
-
+ /* dynamic vertex, cannot use display list */
+ m_bDynamic = true;
/* indicate that the m_transverts and normals are up to date */
return true;
}