Optimizing distance between surfaces calculations
I need to find the distance between an object and a very large mesh (65000 triangles). I have a loop to determine the distance between vertices using Vector3.Distance (these correspond to vertex colors on the object, creating a distance map). It works, but Unity crashes when I do it for the large mesh (too many calculations).
What are ways I can optimize so I do not have to go through each vertex but can maintain the integrity of an object with a complex shape ? Would appreciate any direction in how to do this computationally/sort through the mesh for relative distances, euclidean path,etc?
If you're assigning a colour to every vertex on the mesh, isn't it inevitable that you're going to have to loop over all of them?
Your answer
Follow this Question
Related Questions
Sprites vs texturesless Meshes - more texture memory with meshes?? 0 Answers
How to use mipmaps in code + detecting different faces of a mesh? 0 Answers
Same mesh and Material, Different Properties in Editor Mode 0 Answers
What does convex do in mesh collider component? 1 Answer
Resources.Load Mesh within file 0 Answers