Hi all,
I have a couple of distinct meshes. Each mesh has vertex pos/normal/uv coord. Currently, I have setup a separate vao for each mesh (each VAO has a VBO for vertices/uv and normals) so in pseudocode it is something like this
//setup
for i:1 to N
bind vao[i]
ARRAY_BUFFER <- vertVBO
(BufferData <- vertices
ARRAY_BUFFER <- normalVBO
(BufferData <- normals
ARRAY_BUFFER <- uvVBO
(BufferData <- uv coords.
ELEMENT_ARRAY_BUFFER <- indices
end for
//render
for i:1 to N
bind vao[i]
glDrawElements (...)
end for
My question is, is this efficient in terms of performance. What other alternates do i have and how do i decide which to choose. From my preliminary search, I have found glMultiDrawElements which consolidates the multiple drawelements call into a single call. Is there any other alternate?