Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  Feature request: API to get the mesh from FluidMesher
#1
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:

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).
Reply


Messages In This Thread
Feature request: API to get the mesh from FluidMesher - by kodra - 09-04-2024, 02:48 AM