POLYMASON

Unity's smoothing angle, explained

Part of Flat shading in Unity for low poly models

The Smoothing Angle is one slider on one tab of Unity's model importer, and it decides whether a low poly model looks like one. This article is everything on that tab that touches normals, what each value does, and how to stop setting it by hand. It is the importer half of flat shading in Unity; the other routes to the same look are a shader that shades flat on its own and, for the colour half, materials that keep the colours flat.

Where it is

Select a model file in the Project window. The Inspector shows the importer with four tabs: Model, Rig, Animation, Materials. On Model, under Geometry, are the settings this article is about: Normals, Normals Mode, Smoothness Source, Smoothing Angle, Tangents, and further down Weld Vertices. Changes take effect when you press Apply at the bottom, and Unity reimports the file.

Normals: Import, Calculate, None

This decides where the normals come from.

  • Import takes the normals stored in the file. If the file has none, Unity calculates them as if you had chosen Calculate. This is the default, and for a file that was exported with the shading you want, it is the right value.
  • Calculate ignores what the file says and builds normals from the geometry, using the settings below. Choose it when the file's normals are wrong or missing.
  • None stores no normals. The mesh renders without lighting response, which is what you want only for something unlit.

Smoothing Angle

Shown when Normals is Calculate. Unity looks at each edge where two faces meet and measures the angle between the faces. Where the angle is less than the Smoothing Angle, the faces share a smoothed normal along that edge and the lighting blends across it. Where the angle is greater, each face keeps its own normal and the edge is hard.

The default is 60 degrees. What that does to common low poly geometry:

geometryangle between facesat 60 degreesat 0 degrees
eight-sided trunk45smooth, looks like a tubeflat, eight visible sides
five-sided bough72flatflat
icosphere foliageabout 42smooth, looks like a ballflat facets
a cube90flatflat
a subdivided, rounded prop10 to 30smoothfaceted

So at the default, a trunk goes smooth and the foliage goes smooth, which is the balloon-on-a-tube look. At 0 nothing blends and every face is flat. Values between are for models that mix rounded and hard-edged parts, where you want the rounded parts smooth and the corners sharp; 30 is a common choice for those. For a low poly model, 0.

Normals Mode

Also under Calculate. When several faces share a smoothed normal, this decides how they are weighted in the average: Unweighted, Area Weighted, Angle Weighted, Area and Angle Weighted, and Unweighted Legacy. At a smoothing angle of 0 nothing is averaged, so the mode does nothing. Leave it.

Smoothness Source

Newer Unity versions add this: whether to use the file's smoothing groups (the s lines in an OBJ, the smoothing groups in an FBX) when deciding what to blend, or to rely on the angle alone. From Smoothing Groups, Prefer Smoothing Groups, From Angle, None. If a file was exported with smoothing groups set to flat, From Smoothing Groups respects that; From Angle uses the slider. For a low poly model, either From Angle with the slider at 0, or a file with flat normals and Normals on Import, is the reliable route.

Weld Vertices

On by default. Before normals are calculated, vertices at the same position are merged. This is what makes a smoothing angle possible at all: without the weld, every face would have its own vertices and nothing would be shared to blend.

It matters in one case. Some exporters produce flat shading not by writing normals but by giving every face its own copies of the vertices, so no two faces share one. Weld Vertices joins those copies back together, and then the smoothing angle applies as if they had been shared all along. If a file like that comes in smooth, either turn Weld Vertices off or set the angle to 0; the angle is the better fix, since the weld also saves memory.

Files that carry proper flat normals are unaffected: Unity welds only vertices whose normals match as well as their positions.

Setting it once: importer presets

Setting Normals and Smoothing Angle per file is fine for one model and tiresome for a pack. Unity's Presets fix it:

  1. Set up one model's importer the way you want: Normals Calculate, Smoothing Angle 0, and anything else, such as Generate Colliders or Read/Write.
  2. Click the preset icon at the top right of the Inspector, the small slider symbol, and Save current to a new preset asset.
  3. Open Project Settings, then Preset Manager. Add the preset for the ModelImporter type, and give it a filter such as a folder path or a glob like Assets/Models/LowPoly/**.

Every model imported into that folder from then on gets those settings. Existing files can be selected together and the preset applied from the same icon.

The check

After Apply, look at the model in the Scene view with one directional light. Hard edges between flat tones is what you want. If you see a gradient wrapping round a trunk, the angle is too high, or Normals is on Import and the file's normals are smooth. The Scene view's shading dropdown has a Normals mode that colours each face by its normal and makes it obvious.

When you should not do this

A model that was meant to be smooth, a character or a rounded prop, looks wrong at 0. And a model whose file already has the right normals should stay on Import; forcing Calculate throws away information the artist put there. The rule is: files with normals, Import; files without, Calculate at 0 for low poly and 60 for smooth.

More in this guide

Or build a tree and see what comes out.