I have a mesh, and it has normals on it already, when I import it it shades lovely and smooth, and I can happily turn off the calculate normals option without a problem.
If I then deform it using a script I have to use mesh.RecalculateNormals() in order to get it to shade properly. The problem is when I do that the process adds seams into my model which shouldn’t be there and then you can see the shapes of the individual tris that make up the mesh.
How can I update the normals without adding seams? This seams like a very basic function to be so wrong, why would recalculating normals add seams?
I believe the reason for the seams is the one described in the reference entry for RecalculateNormals():
In other words, your model has places where vertices are duplicated.
You can solve this either by fixing the model to not have duplication or by recalculating the normals yourself. Removing the duplication will probably be hard, if not impossible, as there is usually a good reason for the duplication (like the mentioned uv-seams). This leaves calculating the normals yourself or accepting the seams.
no I have no duplicate vertices. That I can easily check in my modelling package.
I also don’t have any uv’s on the model so that’s out.
Recalculating the normals myself is an option, but it’s propbably going to be too slow.
I guess I’ll have to log a bug and hope at some point it gets fixed, man that’s annoying.
So I have found a problem, even though I export tristrips with normals and turn off create normals in the importer it still goes and adds vertices to my mesh when imported in places where they should be shared, grrrrrrrr
When I export it it has 2412 but if I echo back the number after import I get 3203. I really hope they sort this out in next version it makes it massively difficult to control the look of anything.
Ok so if I bang up the smoothing angle to 180 it only adds about 30 or so extra vertices, which is much better, not as good as just using what comes in but ok for now.
Unity never adds vertices unnecessarily…if it’s adding them, it’s because it has to, for hard edges or UV seams.
–Eric
Well there’s something else going on then because before I turned up the smoothing angle from 90 degrees it was inserting vertices all over the place in the middle of flat smooth areas with no uv seams in them.
~4 years later and I have the same problem but with a procedurally generated mesh. I have a grid of vertices with displaced heights, only one vertex at each point on the grid (no duplication), and yet the recalculate normals function makes it look really shitty. It looks almost like per-vertex lighting.
If you generate it procedurally, how do you check you share vertices at each point? Do you have some code for the mesh generation we can see? Because the sad truth is: You are doing something wrong. Recalculate normals just works, and the only way it can produce hard edges, is if multiple vertices exist at a given point.