Legacy Documentation: Version 2018.2 (Go to current version)
Mesh Components
Material
Other Versions

Meshes

Switch to Scripting

Meshes make up a large part of your 3D worlds. Aside from some Asset storeA growing library of free and commercial assets created by Unity and members of the community. Offers a wide variety of assets, from textures, models and animations to whole Project examples, tutorials and Editor extensions. More info
See in Glossary
plugins, Unity does not include modelling tools. Unity does however have great interactivity with most 3D modelling packages. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons.

Textures

Unity will attempt to find the textures used by a meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
automatically on import by following a specific search plan. First, the importer will look for a sub-folder called Textures within the same folder as the mesh or in any parent folder. If this fails, an exhaustive search of all textures in the project will be carried out. Although slightly slower, the main disadvantage of the exhaustive search is that there could be two or more textures in the project with the same name. In this case, it is not guaranteed that the right one will be found.

Place your textures in a <span class=TexturesAn image used when rendering a GameObject, Sprite, or UI element. Textures are often applied to the surface of a mesh to give it visual detail. More info<span class="tooltipGlossaryLink">See in Glossary</span> folder at or above the assets level">
Place your textures in a TexturesAn image used when rendering a GameObject, Sprite, or UI element. Textures are often applied to the surface of a mesh to give it visual detail. More info
See in Glossary
folder at or above the asset’s level

Material tab of the Import Settings window

Material Generation and Assignment

For each imported material Unity will apply the following rules:-

If material generation is disabled (i.e. Import Materials is unchecked), then it will assign the Default-Diffuse material. If it is enabled then it will do the following:

  • Unity will pick a name for the Unity material based on the Material Naming setting
  • Unity will try to find an existing material with that name. The scope of the Material search is defined by the Material Search setting.
  • If Unity succeeds in finding an existing material then it will use it for the imported sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    , otherwise it will generate a new material

Colliders

Unity uses two main types of colliders: Mesh CollidersA free-form collider component which accepts a mesh reference to define its collision surface shape. More info
See in Glossary
and Primitive Colliders. Mesh colliders are components that use imported mesh data and can be used for environment collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a rigidbody component and is in motion. More info
See in Glossary
. When you enable Generate Colliders in the Import Settings, a Mesh colliderAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary
is automatically added when the mesh is added to the Scene. It will be considered solid as far as the physics system is concerned.

If you are moving the object around (a car for example), you can not use Mesh colliders. Instead, you will have to use Primitive colliders. In this case you should disable the Generate Colliders setting.

Animations

You can import animations from a Model fileA file containing a 3D data, which may include definitions for meshes, bones, animation, materials and textures. More info
See in Glossary
. Follow the guidelines for exporting FBX files from your 3D modeling software before importing it into Unity.

Normal mapping and characters

If you have a character with a normal map that was generated from a high-polygon version of the model, you should import the game-quality version with a Smoothing angle of 180 degrees. This will prevent odd-looking seams in lighting due to tangent splitting. If the seams are still present with these settings, enable Split tangents across UV seams.

If you are converting a greyscale image into a normal map, you don’t need to worry about this.

Blendshapes

Unity has support for BlendShapes (also called morph-targets or vertex level animation). Unity can import BlendShapes from .FBX (BlendShapes and controlling aninimation) and .dae (only BlendShapes) exported 3D files. Unity BlendShapes support vertex level animation on vertices, normals and tangents. Mesh can be affected by skin and BlendShapes at the same time. All meshes imported with BlendShapes will use SkinnedMeshRenderer (no mater if it does have skin or not). BlendShape animation is imported as part of regular animation - it simply animates BlendShape weights on SkinnedMeshRenderer.

There are two ways to import BlendShapes with normals:

  1. Set NormalsThe direction perpendicular to the surface of a mesh, represented by a Vector. Unity uses normals to determine object orientation and apply shading. More info
    See in Glossary
    import mode to Calculate, this way same logic will be used for calculating normals on a mesh and BlendShapes.
  2. Export smoothing groups information to the source file. This way, Unity will calculate normals from smoothing groups for mesh and BlendShapes.

If you want tangents on your BlendShapes then set TangentsOne of two handles that controls the shape of the animation curve before and after a key. Tangents appear when a key is selected in the Curves view, or when a key is selected in the Curve Editor.
See in Glossary
import mode to Calculate.

Hints

  • Merge your meshes together as much as possible. Make them share materials and textures. This has a huge performance benefit.
  • If you need to set up your objects further in Unity (adding physics, scripts or other coolness), save yourself a world of pain and name your objects properly in your 3D application. Working with lots of pCube17 or Box42-like objects is not fun.
  • Make your meshes be centered on the world origin in your 3D app. This will make them easier to place in Unity.
  • If a mesh does not have vertex colors, Unity will automatically add an array of all-white vertex colors to the mesh the first time it is rendered.

The Unity Editor shows too many vertices or triangles (compared to what my 3D app says)

This is correct. What you are looking at is the number of vertices/triangles actually being sent to the GPU for renderingThe process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
See in Glossary
. In addition to the case where the material requires them to be sent twice, other things like hard-normals and non-contiguous UVs increase vertex/triangle counts significantly compared to what a modeling app tells you. Triangles need to be contiguous in both 3D and UV space to form a strip, so when you have UV seams, degenerate triangles have to be made to form strips - this bumps up the count.


Did you find this page useful? Please give it a rating:

Mesh Components
Material