I am getting a GL ERROR :GL_INVALID_OPERATION : glDrawElements: range out of bounds for buffer when my BufferGeometrys index attribute is a Uint8Array. It does however work with Uint16Array.
I created this jsfiddle which demonstrates the problem. Go down to the line noted and change the type from Uint16Array to Uint8Array to see the issue.
The offending code looks to be these lines in WebGLIndexedBufferRenderer such that when it encounters Uint8Array it does not set the size to 1 but 2 instead. It seems as though THREE.js just doesn't support it. Is it intentional or is there some other reason?
Tested
Yeah, seems the only problem was that one conditional. Here's the fixed JSFiddle.
Pull request: #10300
Sweet.
I do not think the docs make it clear what BufferGeometry.index is, or what values it takes.
@looeee Would you be willing to have a look?
@WestLangley sure, it'll be about a week before I have time but I'll make a note of it :)
Bug fixed by #10300.
Most helpful comment
@WestLangley sure, it'll be about a week before I have time but I'll make a note of it :)