#OpenGL Draw Elements

8 messages · Page 1 of 1 (latest)

old kindle
#

Heyy everyone,

I want to draw multiple elements with OpenGL and buffers. The problem is that i want to draw multiple elements with different type, position, orientation... And create or delete when i wish it (when the program is running). So i start to think to a good way to code this and learn about the bunch of functions available as glDrawElements()

But unfortunately, i don't understand the difference between all, even after reading the doc and searching on internet.
So, can someone please explain to me the meaning of these functions ? (and the best, for you, for my plan)

deft violetBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

buoyant siren
#

Can you specify wich functions you are reffering to except glDrawElements?

old kindle
#

glMultiDrawElements
glMultiDrawElementsBaseVertex
glMultiDrawElementsIndirect
glDrawElementsIndirect

buoyant siren
#

So you want to change the model you draw on the fly?
Anyways:

glMultiDrawElements:
Draws vertices from a VAO with VBO and EBO, but it enables you to draw multiple of these where you can choose which part of the VAO or EBO in that case you want to render. also gives you access to gl_DrawId in the shader wich allows you to use different uniforms for each sequence of points

glMultiDrawElementsBaseVertex
the same but allows you to offset the indices for each draw call

glMultiDrawElementsIndirect
allows you to specify the parameters via a struct

glDrawElementsIndirect
same but only for one draw call

old kindle
#

okay thanks i'll see that

deft violetBOT
#

@old kindle Has your question been resolved? If so, type !solved :)

old kindle
#

!solved