fix webgl warning and remove consolelog

This commit is contained in:
gbrochar 2020-11-24 19:44:32 +01:00
parent aef5e53cc3
commit 68de8a2af3
2 changed files with 7 additions and 9 deletions

View File

@ -470,13 +470,6 @@ function drawScene(gl: any,
gl.enableVertexAttribArray(programInfo.attribLocations.textureCoord); 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 // Tell WebGL which indices to use to index the vertices
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices);
@ -496,6 +489,13 @@ function drawScene(gl: any,
false, false,
modelMatrix); 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 vertexCount = length;
const type = gl.UNSIGNED_SHORT; const type = gl.UNSIGNED_SHORT;

View File

@ -110,7 +110,5 @@ export function convert (objText) {
outUVs.push(...uvs[d[1] - 1]); outUVs.push(...uvs[d[1] - 1]);
} }
console.log(indices);
return [outPositions, outNormals, outUVs, indices]; return [outPositions, outNormals, outUVs, indices];
}; };