Search Unity

Question Writing generated mesh to MeshFilters through Job System?

Discussion in 'C# Job System' started by Nyanpas, May 21, 2021.

  1. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Greetings,
    I am using (and perusing) the new Mesh-API in Unity for a variety of things now and I like that it is so blazingly fast. One thing I don't like though is that it seems (so far) that I have to call the
    Mesh.ApplyAndDisposeWritableMeshData() on the thread of main for the meshes I have created to render. I would rather it was all up to the ParallelJobs to handle this if possible so that whenever a mesh is done it just appears into its designated filter. Since there can be a large variety in mesh complexity (from a few hundred vertices up to a million) it would be good to have this as an option.

    Anyone done anything with this or knows it is possible?