Open hughsk opened 9 years ago
Yeah, I've been hit with this too. I think the best solution is really to just not use element arrays in WebGL 1.0 and advocate that users manually unindex everything (it also has some bad performance issues due to the index buffer validation requirements).
Ah, interesting to hear about the performance issues! Do you know if that's only for the initial upload or for each render?
It is implementation dependent. I think it only happens first time you call draw, where it does an expensive check and then caches the result. These cached results get invalidated each time you update the buffer, vertex buffer or change the draw call parameters.
The performance can be tough to predict though and it isn't consistent across implementations. Overall, I'd recommend just not using drawElements ever.
I just ran into this issue, which WebGL deals with silently: http://stackoverflow.com/questions/4998278/is-there-a-limit-of-vertices-in-webgl
It'd be nice if
gl-vao
(or maybe justgl-geometry
) gave you a heads up about this and suggested some workarounds (i.e. splitting the mesh into multiple draw calls, unindexing it, or using theOES_element_index_uint
extension).