I am porting my game engine(c++) to Emscripten, which unfortunately only supports OpenGL ES 3.(Not 3.2) Therefore I don't have access to glDrawElementsBaseVertex, which is needed by my renderer(Canvas2D Renderer). It is needed because this way I can combine all my triangles in one draw call, instead of multiple hundred draw calls. So I need something that does the same. I can't just use normal draw calls, because it would be horribly slow and would require redesigning my Canvas2D class.

The reason I need so many draw calls is because the user can use a Canvas2D to draw single/multiple 2D triangles on the screen, which are then combined into one array. Because the user can also send multiple triangle set's, the indexes need an offset to work correct, which is why I need glDrawElementsBaseVertex.

Does anyone know how to replace glDrawElementsBaseVertex with something that does the same?



1 Answer 1


If there was something that did the same thing, why would OpenGL have even had that as a separate function?

The only thing you can do is pre-offset the indices you're assembling in your index buffer.


You must log in to answer this question.