POLYMASON

Unity's smoothing angle, explained

Part of Flat shading in Unity for low poly models

The Smoothing Angle is a slider on the Model tab of Unity's model importer. At its default it smooths the facets off a low poly model, and at 0 it leaves them alone. This article goes through everything on that tab that touches normals, what each value does, and how to stop setting it by hand. It's the importer part of flat shading in Unity. The other route to the same look is a shader that shades flat on its own, and materials that keep the colors flat covers the color side.

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. Nothing changes until you press Apply at the bottom, and then Unity reimports the file.

Normals: Import, Calculate, None

This setting 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'd chosen Calculate. This is the default, and it's the right value for a file that was exported with the shading you want.
  • 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 doesn't respond to lighting, so use it only for something unlit.

Smoothing Angle

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

The default is 60 degrees. This table shows what that does to common low poly geometry, next to what 0 does:

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

At the default, the trunk goes smooth and so does the foliage, which gives you the balloon-on-a-tube look. At 0 nothing blends and every face is flat, so use 0 for a low poly model. The values in between are for models that mix rounded and hard-edged parts, where you want the rounded parts smooth and the corners sharp. A common choice for those is 30.

Normals Mode

This one also appears under Calculate. When several faces share a smoothed normal, it decides how they're weighted in the average. The options are Unweighted, Area Weighted, Angle Weighted, Area and Angle Weighted, and Unweighted Legacy. At a smoothing angle of 0 nothing is averaged, so the mode has no effect and you can leave it alone.

Smoothness Source

Newer Unity versions add this setting. It chooses whether Unity uses the file's smoothing groups (the s lines in an OBJ, the smoothing groups in an FBX) when it decides what to blend, or relies on the angle alone. The values are From Smoothing Groups, Prefer Smoothing Groups, From Angle and None. If a file was exported with its smoothing groups set to flat, From Smoothing Groups respects that, while From Angle uses the slider. For a low poly model there are two reliable routes. One is From Angle with the slider at 0. The other is a file with flat normals and Normals on Import.

Weld Vertices

Weld Vertices is on by default. Before the normals are calculated, it merges vertices that sit at the same position. A smoothing angle depends on this, because without the weld every face would have its own vertices and there'd be nothing shared to blend.

It causes trouble in one case. Some exporters don't write normals at all and get flat shading by giving every face its own copies of the vertices, so that no two faces share one. Weld Vertices joins those copies back together, and then the smoothing angle applies as if they'd 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 flat normals of their own aren't affected, because Unity only welds vertices whose normals match as well as their positions. The match has a small tolerance. In a test import of a PolyMason oak into Unity 6, welding left 24 of 318 triangles with corner normals up to 2.6 degrees apart, which you can't see. With Weld Vertices off, every triangle came in exactly flat.

Setting it once: importer presets

Setting Normals and Smoothing Angle on each file is fine for one model and tedious for a pack. Unity's Presets take care of that:

  1. Set up one model's importer the way you want it: Normals on Calculate, Smoothing Angle at 0, and anything else you need, such as Generate Colliders or Read/Write.
  2. Click the preset icon at the top right of the Inspector, which is the small slider symbol, and use Save current to to make 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/**.

From then on, every model imported into that folder gets those settings. For files that are already there, select them together and apply the preset from the same icon.

The check

After you press Apply, look at the model in the Scene view with one directional light. You want hard edges between flat tones. If you see a gradient wrapping around a trunk, either the angle is too high, or Normals is on Import and the file's normals are smooth. To look at the normals themselves, use URP's Rendering Debugger (Window, Analysis, Rendering Debugger), which can show world-space normals under Material. In the Built-in pipeline, the Scene view's Deferred draw mode shows them when the camera renders deferred. Flat normals show as one solid color per face.

When you should not do this

A model that was meant to be smooth, such as a character or a rounded prop, looks wrong at 0. A model whose file already has the right normals should stay on Import, because forcing Calculate throws away information the artist put there. So use Import for files that have normals. For files that don't, use Calculate, at 0 for low poly and at 60 for smooth.

More in this guide

  • Flat shading in Unity for low poly modelsWhy a low poly model goes smooth when it lands in Unity, what the importer's Normals and Smoothing Angle settings do, the three places you can fix it, and how to keep the colors flat as well. Three articles underneath go into the detail.
  • A flat shading shader for Unity (Built-in, URP)How to shade any mesh flat from the shader alone by using screen-space derivatives to get the face normal. Includes a working Built-in shader, a URP version, the Shader Graph node, and the caveats.
  • Materials for low poly models in UnityThe three ways a low poly model can carry color and what each costs in draw calls and setup. How to set up a palette texture material in Built-in and URP with the right filtering, and how batching and instancing change the choice for a forest.

Or build a tree and see what comes out.