# Is there a way to specify normals as per-face instead of per-vertex in Unity?

The documentation says that mesh.normals

are assigned to vertices, not triangles.

I've got a somewhat detailed mesh where faces are joining at right angles. If I don't set the normals, everything takes on a kind of metallic appearance. If I set the normals on the vertices, though, then I have to specify which face I'm using and then the edges are very rounded.

I don't mind making separate meshes for each surface, but it seems kind of a waste to not share the vertices. Is there a way to specify per-face normals instead of per-vertex?

I tried for a while to do this, but there was no way of setting normals that I could find that resulted in the appearance I wanted. With shared vertices, the object came out looking like this (a dynamic cylinder with a hole in the middle):

I bailed on the shared vertices and created separate sections; left, right, interior, exterior, assigned the normals there (Vector3.left or Vector3.right for the appropriate sides or "spoke" rays for the interior/exterior surfaces) and got the following:

This is a dynamic mesh, so I'm free to increase the number of sections that comprise the shape. Above is 12 sections, below is 30:

I went from lumpy toilet paper to the crisp edges I was looking for. Seems somewhat less efficient, but I tried to consider for a while how I could instruct unity to smooth some edges and not others and couldn't think of a reasonable way to do it (which is probably why things are the way they are.)

I was a bit concerned that Unity would smooth the outer surface but not smooth the corners, resulting in a wonky edge where the two meshes meet, but that wasn't an issue. That might be because all the "sub-meshes" are all actually on the same mesh in the script, but I've got a satisfactory result now and I'm not willing to spend a lot of time trying to find ways to break it.

• The vertex separation you describe is exactly how the graphics pipeline works, in every game engine (or at least any that use the GPU rather than their own software solution). The idea of "one" vertex having more than one normal, or a "smooth" versus "hard" edge, is effectively a fiction used by 3D modelling software to make manipulating meshes more intuitive, but under the hood there are separate vertices for each unique combination of attributes meeting at that point. See this earlier Q&A for more info Aug 29 '19 at 0:53
• @DMGregory - Neat read, and again makes sense to me from a conceptual standpoint. I'm new-ish to Unity and dynamic meshes; I've got a really strong background with Matlab and doing meshes (by hand lol) with the patch command there. As with most things Matlab, they've got some workarounds for handling the normals and encourage you to share vertices to keep the vertex array small (the line just above "Behavior of the patch Function.") Thanks for directing me to the other post! Aug 29 '19 at 16:38