I am loading two kinds of tiles (Meshes in tiles format) in unity both are placed in the environment correctly but there is a gap between these two tiles. Like the picture below
I want to fill this gap automatically either through scripting or a shader. With Scriptings, here is the algorithm I thinking but its first step taking too much time.
- Get Each tile and get the outer edges of the Mesh (it’s getting to much time to calculate with each tiles as there are thousands of tiles)
- Then ray cast from the outer edges of the mesh and get intersection point of outer tiles
- take vertices and draw the mesh.
I have get stuck in the first steps as it taking so much time to calculate the outer edges of a tile. Maybe there is a solution available in form of a shader that work between gapes of two meshes?