diff --git a/src/client/main.ts b/src/client/main.ts index 93c1357..d8b25b6 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -470,13 +470,6 @@ function drawScene(gl: any, gl.enableVertexAttribArray(programInfo.attribLocations.textureCoord); } - // Tell WebGL we want to affect texture unit 0 - gl.activeTexture(gl.TEXTURE0); - // Bind the texture to texture unit 0 - gl.bindTexture(gl.TEXTURE_2D, texture); - // Tell the shader we bound the texture to texture unit 0 - gl.uniform1i(programInfo.uniformLocations.uSampler, 0); - // Tell WebGL which indices to use to index the vertices gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); @@ -496,6 +489,13 @@ function drawScene(gl: any, false, modelMatrix); + // Tell WebGL we want to affect texture unit 0 + gl.activeTexture(gl.TEXTURE0); + // Bind the texture to texture unit 0 + gl.bindTexture(gl.TEXTURE_2D, texture); + // Tell the shader we bound the texture to texture unit 0 + gl.uniform1i(programInfo.uniformLocations.uSampler, 0); + { const vertexCount = length; const type = gl.UNSIGNED_SHORT; diff --git a/src/client/objparser.js b/src/client/objparser.js index 5c02517..d02d9df 100644 --- a/src/client/objparser.js +++ b/src/client/objparser.js @@ -110,7 +110,5 @@ export function convert (objText) { outUVs.push(...uvs[d[1] - 1]); } - console.log(indices); - return [outPositions, outNormals, outUVs, indices]; }; \ No newline at end of file