I have this system where i average two meshes into one, based on a percentage (ex. 90% first mesh and 10% second mesh). It works perfectly with meshes with same poly counts (because I average vertex position). I made two models in blender, first a literal cuboid. Then I used this cuboid and only changed vertex positions, without adding any new ones to take a different shape (again, no new vertices). In blender, their vertex count are the same.
But then I import both of them to unity:
I understand that unity and blender have different understanding of vertices, the vertex number should be higher in unity, but shouldn’t it also be the same in both models?
Is there any way to make those meshes have same vertex count?
Is this a unity bug?
Hi @imicz08 If you wouldn’t mind, take a look at the import settings for the model in unity. What are the settings for Mesh Compression and Optimize Mesh? What happens if you set Compression to Off and set Optimize Mesh to Nothing, then reimport?
I understand that unity and blender
have different understanding of
vertices, the vertex number should be
higher in unity, but shouldn’t it also
be the same in both models?
If those are two different models, why should they? Do you even understand why the GPU requires the splitting of vertices? This is nothing related to Unity but what a vertex means to your GPU. Reasons why a vertex may be split up are:
- different normals
- different UV coordinates
- different vertex color
< insert any other vertex attribute here>.
Modelling software may still treat a vertex as one but due to the data stored in a single vertex it may need to be split into several. The prime example is a cube. Everybody knows a cube has 8 “logical” vertices. However a cube mesh requires 24 vertices because the vertex normal of each face need to be unique for each face. Since there are always 3 faces that meet at a corner, each vertex need to be split into 3. When you apply UV mapping to your model, this could also make the vertices split.
If the two models are based on the same initial model, there are several reasons why it may turn out different. First of all, like @AnOrdinarySandwich mentioned mesh optimisation / compression can be one reason. Other reasons may be that you didn’t export / import normals but let Unity recalculate them. Unity decides which faces should be flat and therefore require a vertex split based on the angle threshold. Mesh optimisation could take out vertices that are coplanar and therefore do not add any information / benefit to the model.