I am trying to generate triangles in a compute shader, which I would then like to render using Graphics.DrawProcedural from a C# script. The compute shader generates two buffers, one containing the vertices of the mesh, and the other contains indices for indexing into the vertex buffer.
My problem arises when I want to draw this, I can’t seem to figure out a way to use the indices to draw triangles, as Graphics.DrawProcedural doesn’t exactly take many parameters. The only solution I can come up with is to create vertices for every triangle and ditch the index buffer, however this can potentially create many duplicate vertices. As I want to draw rather complex meshes (marching cubes) this would probably end up being too heavy memory wise.
Anyone have a good idea on how I can solve this?