My use case is that I'm working on my own custom fluid shader. The workflow is tedious: Press Play -> Wait for the simulation until the fluid gets to a certain shape I'd like to inspect the shader for -> Tweak the shader.
I figured that if I dump the mesh from BurstFluidMesherSystem as an Unity asset, it would make iterating on the shader much faster. So I added this API:
It works. I kinda hope it's officially supported tho, cause 1. I don't know if it's the correct way to do it 2. It's not that easy for Compute backend as the mesh only lives in GPU (I suppose).
I figured that if I dump the mesh from BurstFluidMesherSystem as an Unity asset, it would make iterating on the shader much faster. So I added this API:
Code:
public List<Mesh> DumpMeshes_Editor()
{
var meshes = new List<Mesh>();
for (int i = 0; i < batchCount; i++)
{
var batch = batchList[i];
meshes.Add(batch.mesh);
}
return meshes;
}
/// then save the mesh with AssetDatabase.CreateAsset...
It works. I kinda hope it's officially supported tho, cause 1. I don't know if it's the correct way to do it 2. It's not that easy for Compute backend as the mesh only lives in GPU (I suppose).