Shading issue on proceduraly deformed mesh

Hi guys,

I’m having a small but weird issue with the shading on my assets. It’s a flat mesh at first and gets spherified at runtime in the editor.
When done, I can see weird shading variations on the mesh which shouldn’t be. The mesh has the same smoothing group all over, the normals are correct and the material also. Took some time to check with the lighting in the scene which looks correct (using Linear and Deferred) so I’m a bit at a loss here.
Any idea why this might happen?

Thanks !

If that is a seam (i.e., does not share vertices), then you will see normal discontinuities if you just use the .RecalculateNormals() method on your spherified mesh:

Exaggerated on a cube, this is what might be going on:

6997292--826649--normals.png
The red arrows would be the auto-calculated normals.

To get around that, you need to recalculate and set normals for each vert. Fortunately on a sphere this is trivial: the normal for ANY vertex should be the normalized position relative to the sphere center.

1 Like

Thanks for the reply Kurt !

For the seams yup that would be normal indeed and quite fixable. What i don’t get is that the weird shading is inside the mesh itself :confused: Everything seems normal so I don’t understand why I get those small weird darker areas on the mesh. I will upload a screenshot of the wireframe maybe it’ll help

here’s a screen of the wireframe from the USA’s after spherical projection from the script. It doesn’t change from when it’s flat, but still maybe it’ll help figure out the issue