I am working on a game project in unity which has a procedurally generated terrain made up of 16*128*16 chunks of blocks. The map size is going to be finite (Possibly up to ~100*100 chunks). Currently the data for the chunk is stored in a 1D Array, and takes a couple milliseconds to generate. But generating the mesh takes longer, averaging 30-40ms. So generating terrain as it enters the range of the camera isn't feasible as it's too slow, and generating all the meshes on load up would take a lot of memory as well as a long time. I've thought about attempting to try it on the GPU through Compute Shaders (although I don't have any experience with them).
Would generating the mesh for each chunk in a Compute Shader be viable/efficient? (The chunks could be made smaller if would be more performant)