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:
authorMitchell Stokes <mogurijin@gmail.com>2013-05-10 09:13:16 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-05-10 09:13:16 +0400
commit073d3ba5f7a5ef8f8255f90ae8b2e24a7114cb1c (patch)
tree697a0171107f40d682cca3c2c4e84e32a97aa038 /source/gameengine/Rasterizer/RAS_BucketManager.cpp
parentfffab3993d68d780fbd202ce3a29dde751207967 (diff)
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.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_BucketManager.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index af8c855f3b0..7d1190bef5c 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -238,13 +238,21 @@ void RAS_BucketManager::Renderbuckets(
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);
}