Three.js: Error using Uint8Array index in WebGLBufferGeometry

Created on 6 Dec 2016  路  4Comments  路  Source: mrdoob/three.js

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.

8358 seems similar but was resolved.

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

  • r82 and r83dev
  • Chrome and Firefox
  • Windows
  • Intel Integrated Graphics

Most helpful comment

@WestLangley sure, it'll be about a week before I have time but I'll make a note of it :)

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings