diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 2c33dd81e323..94ac878029a4 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -174,10 +174,12 @@ void RAS_BucketManager::RenderSortedBuckets(const MT_Transform& cameratrans, RAS bucket->RenderMeshSlot(cameratrans, rasty, sit->m_ms); } + // Always unbind VBO or VA before unset the material to use the correct material attributs. + rasty->UnbindPrimitives(lastDisplayArrayBucket); + if (matactivated && lastMaterialBucket) { lastMaterialBucket->DesactivateMaterial(rasty); } - rasty->UnbindPrimitives(lastDisplayArrayBucket); } void RAS_BucketManager::RenderBasicBuckets(const MT_Transform& cameratrans, RAS_IRasterizer *rasty, RAS_BucketManager::BucketType bucketType)