Skip to content

Commit dae0b2c

Browse files
committed
Fixed Multi Texture support across split texture atlases.
1 parent 8ab7dc8 commit dae0b2c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/renderer/webgl/BatchManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Phaser.Renderer.WebGL.BatchManager.prototype = {
291291

292292
var tempTexture = this.renderer.createEmptyTexture(1, 1, 0);
293293

294-
for (i = 0; i < this.maxTextures; i++)
294+
for (i = 0; i < this.renderer.maxTextures; i++)
295295
{
296296
gl.activeTexture(gl.TEXTURE0 + i);
297297

@@ -304,7 +304,7 @@ Phaser.Renderer.WebGL.BatchManager.prototype = {
304304

305305
gl.activeTexture(gl.TEXTURE0);
306306

307-
gl.uniform1iv(this.uSamplerArray, indices);
307+
gl.uniform1iv(this.uSampler, indices);
308308
}
309309
else
310310
{
@@ -360,7 +360,7 @@ Phaser.Renderer.WebGL.BatchManager.prototype = {
360360
{
361361
if (this.renderer.textureArray[textureSource.glTextureIndex] !== textureSource)
362362
{
363-
console.log('setCurrentTexture - batch size', this.currentBatchSize);
363+
// console.log('setCurrentTexture - batch size', this.currentBatchSize);
364364
// console.log(textureSource);
365365

366366
if (this.currentBatchSize > 0)
@@ -370,7 +370,7 @@ Phaser.Renderer.WebGL.BatchManager.prototype = {
370370

371371
gl.activeTexture(gl.TEXTURE0 + textureSource.glTextureIndex);
372372

373-
console.log('activeTexture', gl.TEXTURE0 + textureSource.glTextureIndex);
373+
// console.log('activeTexture', gl.TEXTURE0 + textureSource.glTextureIndex);
374374

375375
gl.bindTexture(gl.TEXTURE_2D, textureSource.glTexture);
376376

src/renderer/webgl/WebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Phaser.Renderer.WebGL = function (game)
8686
*/
8787
this.stencilBufferLimit = 6;
8888

89-
this.multiTexture = false;
89+
this.multiTexture = true;
9090

9191
this.extensions = {};
9292

0 commit comments

Comments
 (0)