#Vertex Buffer semantics for hypothetical voxel engine

4 messages · Page 1 of 1 (latest)

full yoke
#

Hey all. Pretty new to vulkan and gfx programming as a whole. Looking into creating a voxel engine and had a thought and wanted to know if it was a decent strategy. I don't know if having multiple vertex buffers is a strategy that is encouraged or even useful... but my thought process would be to have a vertex buffer specifically for voxels that are runtime generated on the CPU - that are converted to something render-able via a compute shader... and then a separate vertex buffer for pre-computed meshes that are loaded in. Id imagine there would be a benefit in doing this rather than storing them all in a single buffer and using crazy descriptor sets to differentiate them? Am i using the right logic here? Looking for all critiques and criticisms.

dapper heart
#

Whether you use 1 vertex buffer or multiple is not very important (when you use 1, you would probably give each mesh a 'section' of your vertex buffer). I would recommend to use the same memory allocation though, just because the number of GPU allocations can be quite limited.

It is definitely sensible to generate your voxel vertices at runtime, regardless of whether it has its dedicated buffer, or not

full yoke
#

I see... thanks for this tip! What would be the best way to go about 'sectioning' the vertex buffer...? is that a descriptor set thing or do I just arbitrarily say "after x amount of voxel vertices is when mesh vertices start".?

dapper heart
#

no need for descriptor sets here. vkCmdBindVertexBuffers has a pOffsets parameter that you can use for this