diff options
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_BucketManager.cpp')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_BucketManager.cpp | 12 |
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); } |