[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56639] trunk/blender/source/gameengine/ Rasterizer/RAS_BucketManager.cpp: BGE: Fix for [#34382] " Vertex position doesn't update when set through Python and " Cast Buffer Shadows" is disabled" reported by V.R.
Mitchell Stokes
mogurijin at gmail.com
Fri May 10 07:13:17 CEST 2013
Revision: 56639
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56639
Author: moguri
Date: 2013-05-10 05:13:16 +0000 (Fri, 10 May 2013)
Log Message:
-----------
BGE: Fix for [#34382] "Vertex position doesn't update when set through Python and "Cast Buffer Shadows" is disabled" reported by V.R. (rolle).
The BucketManager was assuming that all modified meshes were rendered when a render pass completed. However, materials that did not cast buffer shadows did not render during the shadow rendering step, and thus were never updated.
Modified Paths:
--------------
trunk/blender/source/gameengine/Rasterizer/RAS_BucketManager.cpp
Modified: trunk/blender/source/gameengine/Rasterizer/RAS_BucketManager.cpp
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_BucketManager.cpp 2013-05-09 19:30:09 UTC (rev 56638)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_BucketManager.cpp 2013-05-10 05:13:16 UTC (rev 56639)
@@ -238,13 +238,21 @@
BucketList::iterator bit;
list<RAS_MeshSlot>::iterator mit;
for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) {
- // RAS_MaterialBucket *bucket = *bit; /* UNUSED */
+ /* This (and the similar lines of code for the alpha buckets) is kind of a hacky fix for #34382. If we're
+ * drawing shadows and the material doesn't cast shadows, then the mesh is still modified, so we don't want to
+ * set MeshModified to false yet. This will happen correctly in the main render pass.
+ */
+ if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows())
+ continue;
+
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
}
}
for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) {
- // RAS_MaterialBucket* bucket = *bit; /* UNUSED */
+ if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows())
+ continue;
+
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
}
More information about the Bf-blender-cvs
mailing list