diff --git a/src/renderers/webgl/WebGLState.js b/src/renderers/webgl/WebGLState.js index 38836927a47b8b..15e3166b4a6dba 100644 --- a/src/renderers/webgl/WebGLState.js +++ b/src/renderers/webgl/WebGLState.js @@ -8,9 +8,10 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) { var color = new THREE.Vector4(); - var newAttributes = new Uint8Array( 16 ); - var enabledAttributes = new Uint8Array( 16 ); - var attributeDivisors = new Uint8Array( 16 ); + var maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); + var newAttributes = new Uint8Array( maxVertexAttributes ); + var enabledAttributes = new Uint8Array( maxVertexAttributes ); + var attributeDivisors = new Uint8Array( maxVertexAttributes ); var capabilities = {};