Ensure the texture is loaded into the correct index.

The previous code would try to load subsequent textures into the 0th slot.
This commit is contained in:
Duck
2021-09-15 09:18:48 -07:00
parent 5afd25150f
commit 17394cc8be
2 changed files with 5 additions and 2 deletions

View File

@@ -426,7 +426,10 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
const uniformName = Uniforms.TILE_TEXTURE_PREFIX + textureIndex;
gl.activeTexture(gl[textureProperty]);
gl.bindTexture(gl.TEXTURE_2D, tileTexture.textures[textureIndex]);
gl.uniform1i(this.helper.getUniformLocation(uniformName), 0);
gl.uniform1i(
this.helper.getUniformLocation(uniformName),
textureIndex
);
}
const alpha =

View File

@@ -284,7 +284,7 @@ class WebGLHelper extends Disposable {
gl.getExtension('OES_element_index_uint');
gl.getExtension('OES_texture_float');
gl.getExtension("OES_texture_float_linear");
gl.getExtension('OES_texture_float_linear');
this.canvas_.addEventListener(
ContextEventType.LOST,