Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimizing rendering through packing vertex buffers [closed]

Tags:

opengl

vulkan

John Carmack recently tweeted:

"Another outdated habit is making separate buffer objects for vertexes and indexes."

I am afraid I don't fully understand what he means. Is he implying that packing all 3D data including vertex, index, and joint data into a single vertex buffer is optimal compared to separate buffers for each? And, if so, would such a technique apply only to OpenGL or could a Vulkan renderer benefit as well?

like image 907
RWilco8 Avatar asked Jun 06 '26 08:06

RWilco8


1 Answers

I think he means there's no particular need to put them in different buffer objects. You probably don't want to interleave them at fine-granularity, but putting e.g. all the indices for a mesh at the beginning of a buffer and then all the vertex data for the mesh following it is not going to be any worse than using separate buffer objects. Use offsets to point the binding points at the correct location in the buffer.

Whether it's better to put them in one buffer I don't know: if it is, I think it's probably ancillary things like having fewer larger memory allocations tends to be a little more efficient, you (or the driver) can do one large copy instead of two smaller ones when copies are necessary, etc.

Edit: I'd expect this all to apply to both GL and Vulkan.

like image 70
Jesse Hall Avatar answered Jun 09 '26 08:06

Jesse Hall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!