Welding Vertices after using CombineMesh

Hi there,

I’ve looked around to find an answer regarding this on here, there are a few threads, but most don’t really lead on to what I’m trying to achieve.

Essentially I work for a groundworks company, and our kit is very repetitive / modular… but there is ALOT of it!

I’ve been trying to work out the best way i can create the models inside the engine, going from creating each model as a single mesh, right down to chopping it up into little pieces per item, and reusing the mini mesh’s to create prefabs of the finished product.

The second option, chopping it up into little parts seems to most efficient in terms of the texture space and ease of recreating the component inside Unity, as I can just create a new prefab and combine it using the pieces again, but when I’m doing it this way, my draw calls go through the roof!

I looked into combine mesh, which does a great job at collapsing my mesh down, greatly reducing the draw calls, but it has a slight issue with the placement of the new collider mesh at the moment, also when there is more than one of these prefabs in the scene, it just removes all the models! Anyway, that’s the back story, I’ll go onto the technical part below with pictures! Below is an example, where this piece of kit may only have 2 holes or another may have 22, hence the modular approach.

The mesh parts are designed in Max, and will ‘tile’ next to each other, but is there a way i can weld those vertices on the mesh seams? I don’t think they are giving me any problems currently (Shown in the second image) but there is alot of wasted resource I can imagine with those vertices being double up. All elements also share the same normals map.

So to summarize…

  1. Is there a way I can weld those edges?

  2. How can I have more control over the generated Collider mesh?

  3. Why do they disappear when there is more than 1!?

Many Thanks!

Darren

Upon closer inspection, it seems to the CombinedMesh that is moving, not the collider! No idea why that is!


Hmm the problems continue… seems this one is flipped, despite not actually using any flipping methods (negative scale value) They both are using the same texture, but it just isn’t right >.< Must be something or someone on here that can offer some insight!? Pretty please!? :slight_smile:

I seem to be in the same situation. Did you ever figure out how to weld those vertices?

I’m not entirely sure that we have the same situations, but here’s my experience.
I was trying to combine tile models along their seams.
Their vertices never seemed to combine completely, and on the opengl backend, pixels would occasionally leak through.
Our solution… we snapped all vertices to a virtual grid, to ensure that corresponding vertices end up at the exact same positions. This made the meshes merge properly, with no light leaking through the seam.

Do any of these libs do what you want?

Mesh Toolkit v1.10 (C#)

- Share double vertices
- Remove unused vertices

trimesh (JS)

- fuse_vertices
Welds nearby vertices together, removing small cracks and sliver faces within a mesh.
The “fuse” function is located at this file : TrimeshJS/src/repair.js at f157e73b430179dfd1d6f8ab94b6ec6cf057cf7e · mikolalysenko/TrimeshJS · GitHub

When I analyzed my script, I used Mesh Toolkit, but my problem was my understanding of whether or not I could get vertices to merge. They did, I just had to be accurate enough with their positions.

I’m running into the same problem. Why doesn’t CombineMeshes just leave welded vertices as welded?