diff --git a/src/core/renderers/webgl/TextureManager.js b/src/core/renderers/webgl/TextureManager.js index d8187a8..700f9f7 100644 --- a/src/core/renderers/webgl/TextureManager.js +++ b/src/core/renderers/webgl/TextureManager.js @@ -80,6 +80,9 @@ const boundTextures = this.renderer.boundTextures; + // if the location is undefined then this may have been called by n event. + // this being the case the texture may already be bound to a slot. As a texture can only be bound once + // we need tofind its current location if it exists. if (location === undefined) { location = 0; @@ -91,6 +94,7 @@ if (boundTextures[i] === texture) { location = i; + break; } } }