Best way to sort draw calls?

Started by
10 comments, last by Chapa 9 years, 8 months ago


Only the mesh needs a vertex buffer. Sub-meshes can do with an index buffer and an offset into the shared vertex buffer.
If you "collapsed" all the sub meshes into a single vertex buffer, why don't go all the way and "collapse" all sub mesh index buffers into a single one? Unless I'm missing something you'd only need to append each index buffer into a single one and it would work.

Then again, you'd need to store an offset (and size) into the index buffer then, so when setting parameters per submesh you can draw only the submesh rather than the whole buffer.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Advertisement

Thank you L. Spiro, with this information it is really clear for me now how to save the data, you have been very helpfull, and i really appreciate the time you are taking to answer me, but i still cant get the whole idea, i understood how to structure the info and also i understood how i could manage the physics and even i got the LOD idea, its pretty simple when using this structure...

But i still cant get, how am i going to put this kind of structure into a render queue, the only idea i get for rendering this, is just having a render method in the model, which is going thru all meshes, and then each mesh is going thru all submeshes, and of course activating what needed on each stage, and finally getting the render of a single model,... the benefits i see on this way is that i will only update constant buffer on each mesh, if its different of course, and i can share the vertexbuffer, even the indexbuffer, just using an offset on the drawcall and knowing the size, but i still will change the material and probably texture for each submesh, which is what everyone tries to avoid, thats what i have been reading everywhere, of course after sorting by rendertype and shaders, this still confuses me...

And again, i am sorry for my english, may be you already tried to explain me this before or gave me an idea about it, but sometimes when reading a whole sentence its just hard for me to understand everything you are trying to tell me.

Thanks again smile.png

This topic is closed to new replies.

Advertisement