For one of my WebGL projects I need to generate lots of objects with indices. For examples, cones. When JavaScript generates not so many everything works fine, by adding another cones to the scene rendering becomes glitchy.


I am pretty sure that the problem is in defining index buffer:
*var iBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array(glIndices), gl.STATIC_DRAW);*
To be more specific with Unit8Array or its transition to shader.
Can anyone help me with that?
Uint16Array?!