diff --git a/v3/src/renderer/webgl/renderers/spritebatch/SpriteBatch.js b/v3/src/renderer/webgl/renderers/spritebatch/SpriteBatch.js index dd4ed9491..a4f8690c0 100644 --- a/v3/src/renderer/webgl/renderers/spritebatch/SpriteBatch.js +++ b/v3/src/renderer/webgl/renderers/spritebatch/SpriteBatch.js @@ -46,6 +46,7 @@ var SpriteBatch = function (game, gl, manager) this.dirty = false; this.drawIndexed = true; this.lastDrawIndexed = true; + this.lastDrawingMesh = false; this.drawingMesh = false; this.vertexCount = 0; @@ -100,9 +101,10 @@ SpriteBatch.prototype = { shouldFlush: function () { - if (this.drawIndexed != this.lastDrawIndexed) + if (this.drawIndexed != this.lastDrawIndexed || this.lastDrawingMesh !== this.drawingMesh) { this.lastDrawIndexed = this.drawIndexed; + this.lastDrawingMesh = this.drawingMesh; return true; } return false;