Version: 2019.1
Mesh Components
Материал

Meshes

Meshes make up a large part of your 3D worlds. Unity provides a modeling tool called ProBuilder and there are also some Asset store modeling plugins, such as Mesh Deformer, UModeler, and Mesh Editor. And Unity has great interactivity with most 3D modeling software.

Unity supports triangulated or quadrangulated polygon Meshes, so you must convert Nurbs, Nurms, and Subdiv surfaces to polygons.

Textures

Unity follows a specific search plan to automatically look for the Textures used by a Mesh on import. First, the importer looks for a sub-folder called Textures within the same folder as the Mesh or in any parent folder. If this fails, Unity performs an exhaustive search of all Textures in the Project. 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 Unity can find the right one.

Place your textures in a Textures folder at or above the assets level
Place your textures in a Textures folder at or above the asset’s level

Material generation and assignment

Enable Import Materials on the Material tab of the Import Settings window
Enable Import Materials on the Material tab of the Import Settings window

If you enable Import Materials and choose Use Embedded Materials from the Location drop-down menu, Unity:

  1. Picks a name for the Unity Material based on the Naming setting.
  2. Looks for an existing Material with that name. The scope of the Material search is defined by the Search setting.
  3. Uses any existing Material it finds for the imported Scene. If Unity doesn’t find a matching Material, it generates a new Material.

Colliders

Unity uses two main types of colliders: Mesh Colliders and Primitive Colliders. Mesh Colliders are components that use imported Mesh data and Unity can use them for environment collision. When you enable Generate Colliders on the Model tab, Unity automatically adds a Mesh collider when you add the Mesh to the Scene so that the physics system considers it solid.

If you are moving the GameObject around (a car for example), you cannot 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 file. 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 prevents odd-looking seams in lighting due to tangent splitting. If the seams are still present with these settings, choose Calculate Legacy With Split Tangents from the Tangents drop-down menu. If you are converting a greyscale image into a normal map, you don’t need to worry about this.

Blend shapes

For information about how to import blend shapes into Unity from 3D modeling applications, see the documentation for the Model tab of the Model Import Settings window.

Hints

  • Merge your Meshes together as much as possible. They should share Materials and Textures as much as possible. This has a huge performance benefit.

  • If you need to set up your GameObjects further in Unity (adding physics, scripts or other components), make sure you name your GameObjects properly in your 3D application. Working with names like pCube17 or Box42 can be very difficult.

  • Center your Meshes on the world origin in your 3D modeling application. This makes it easier to place them in Unity.

  • If a Mesh does not have vertex colors, Unity automatically adds an array of all-white vertex colors to the Mesh the first time Unity renders it.

  • The Unity Editor shows too many vertices or triangles (compared to the original Model in your 3D modeling application).

    This is correct. What you are looking at is the number of vertices/triangles actually being sent to the GPU for rendering. 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 3D modeling application 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, which bumps up the count.

Mesh Components
Материал