- Home /
How can I make the shading on my mesh look like the primitives?
I've got a pretty simple mesh that I'm using, however, as you can see in the screen shot, it won't shade in the same way as a primitive cube. Both objects have the same material on them. Any suggestions? I'm having unity calculate the normals for me, could that be the problem?
Where are you making your mesh? A 3D program like Blender? If that is the case, check to see if you are using smooth edges or vertices.
Answer by FortisVenaliter · Jul 24, 2017 at 07:01 PM
The problem is the normals. Your mesh is sharing normals on edges between faces (often called "edge-smoothing"). The unity one has separate normals for each faces' vertices.
You'll need to fix the normals in your mesh editor before re-exporting to Unity.
They can also be changed in Unity. Select your mesh in the Project view and you can have Unity calculate normals for you. You also have the option to change the edge break angle
Hi, thanks for the replies. I have generated the mesh in unity and had unity calculate the normals for me. Where do I access the break angle for the normals?
I believe he's talking about the slider you have when importing for example an FBX file and unity generates a mesh asset for you based on the data in it.
If you have a pure mesh asset in unity (for example dynamically created by code), you don't have this slider because it doesn't need to be imported, it's already a mesh. $$anonymous$$ore here
In this case you need to manually create the mesh so that it has the extra normals to make edges sharp. For example for a cube, you'd need to make each side use 4 separate vertices/normals and use those to draw the 2 triangles that make up the side.
Answer by MarshCZA · Jul 26, 2017 at 12:51 PM
It turns out this is happening because I am sharing vertices. This means that the normals are pointing directly out at each corner. By having 3 vertices at each corner of the mesh I can properly direct the normals for each face.