0
\$\begingroup\$

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?

Thanks!

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.