Skip to content

Commit 3b9d115

Browse files
committed
Reset just units 0 and 1
1 parent d7cf9da commit 3b9d115

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ var WebGLRenderer = new Class({
14871487
},
14881488

14891489
/**
1490-
* Flushes the current pipeline, then resets all of the textures
1490+
* Flushes the current pipeline, then resets the first two textures
14911491
* back to the default temporary textures, resets the start active
14921492
* counter and sets texture unit 1 as being active.
14931493
*
@@ -1501,20 +1501,17 @@ var WebGLRenderer = new Class({
15011501
var gl = this.gl;
15021502
var temp = this.tempTextures;
15031503

1504-
for (var i = 0; i < temp.length; i++)
1505-
{
1506-
gl.activeTexture(gl.TEXTURE0 + i);
1504+
gl.activeTexture(gl.TEXTURE0);
1505+
gl.bindTexture(gl.TEXTURE_2D, temp[0]);
15071506

1508-
gl.bindTexture(gl.TEXTURE_2D, temp[i]);
1509-
}
1507+
gl.activeTexture(gl.TEXTURE1);
1508+
gl.bindTexture(gl.TEXTURE_2D, temp[1]);
15101509

15111510
this.normalTexture = null;
15121511
this.textureZero = null;
15131512

15141513
this.currentActiveTexture = 1;
15151514
this.startActiveTexture++;
1516-
1517-
gl.activeTexture(gl.TEXTURE1);
15181515
},
15191516

15201517
/**

0 commit comments

Comments
 (0)