Batching hundreds of unique CommandBuffer.DrawProcedural commands?

Heya I have a many procedurally generated chunks of square-faced voxels and I’m exploring my options as to rendering them. (because I’m salty Ethan Gore can manage infinite render distance with 2000fps)

So far I’m just looping through all available mesh data (array of vertices, and triangles) and simply call CommandBuffer.DrawProcedural - I have my own shader with it as well with a decent amount of data packing (just the vertex position data packed into a single int). This is taking 3-4ms to render (not including cpu overhead), I’m hoping to get down to 2ms before I work on other optimisations such as LODs but I want to work on the low level stuff first. I would like to know the best step to take from here.

I’m considering the following options:

  • Using indirect commands and packing my data more tightly for faster memory transfers (not explicit paths but I should do these for whatever other option I go with)
  • Combine my chunks into far larger regions, maybe even just combine every single chunk into one mega chunk because it surely won’t be over 100mil vertices loaded at one time (although Ik this will make culling significantly harder). Either on CPU via burst jobs or GPU via compute.
  • Figure out instancing for unique meshes but I’m quite inexperienced with shaders in general and everything I’ve read on instancing has flown way over my head - I was under the impression that instancing means you render the same mesh multiple times but apparently you can use that to render many unique meshes. I’m not sure if this is either by using geometry shaders to add geometry from an instance ID and one massive combined buffer for vertices and indices, or if what people talk about is just instancing a tonne of faces.
  • Suddenly discover some magical Unity function to draw many meshes that are combined in a large buffer with an indirect command buffer, unless that is already a feature that I’m describing which would be very ironic.

I don’t really know where to go from here, I have recently tested the feasibility of combining all my data into a buffer and that works fine, I just need to figure out how to render it. Maybe there’s another option that I haven’t considered at all? Maybe there’s a way to access some sort of low-level rendering api (sacrificing cross-platform capabilities ofc)?

I read up about this article on fast voxel rendering - linked to by Ethan Gore - and it goes on about vertex pooling and stuff, but I doubt Unity has a good equivalent, let alone any form of multi-draw.

Any unity gurus that can point me in the correct direction? (and perhaps some actually good documentation because I’m sick of being handed the method parameters and a single lame example and be expected to just know how it works).

Thanks.