Fix T38379: Mesh vertices only update when in cone of last created spotlight

The shadow render passes could set a mesh's modified status to false
even if they were not rendered. This means their display lists do not
get updated. For now, just skip setting all buckets' modified to false
during shadow render passes.
This commit is contained in:
Mitchell Stokes 2014-05-12 23:13:27 -07:00
parent 43f3e79cee
commit 2055e968df

@ -228,28 +228,24 @@ void RAS_BucketManager::Renderbuckets(const MT_Transform& cameratrans, RAS_IRast
RenderSolidBuckets(cameratrans, rasty); RenderSolidBuckets(cameratrans, rasty);
RenderAlphaBuckets(cameratrans, rasty); RenderAlphaBuckets(cameratrans, rasty);
/* All meshes should be up to date now */ /* If we're drawing shadows and bucket wasn't rendered (outside of the lamp frustum or doesn't cast shadows)
/* Don't do this while processing buckets because some meshes are split between buckets */ * then the mesh is still modified, so we don't want to set MeshModified to false yet (it will mess up
BucketList::iterator bit; * updating display lists). Just leave this step for the main render pass.
list<RAS_MeshSlot>::iterator mit; */
for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) { if (rasty->GetDrawingMode() != RAS_IRasterizer::KX_SHADOW) {
/* This (and the similar lines of code for the alpha buckets) is kind of a hacky fix for #34382. If we're /* All meshes should be up to date now */
* drawing shadows and the material doesn't cast shadows, then the mesh is still modified, so we don't want to /* Don't do this while processing buckets because some meshes are split between buckets */
* set MeshModified to false yet. This will happen correctly in the main render pass. BucketList::iterator bit;
*/ list<RAS_MeshSlot>::iterator mit;
if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows()) for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) {
continue; for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { }
mit->m_mesh->SetMeshModified(false);
} }
} for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) {
for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows()) mit->m_mesh->SetMeshModified(false);
continue; }
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
} }
} }