Identify and mitigate common visual artifacts in meshes generated by the 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 LODThe Level Of Detail (LOD) technique is an optimization that reduces the number of triangles that Unity has to render for a GameObject when its distance from the Camera increases. More info
See in Glossary feature.
When Unity generates LODs, each subsequent LOD index has fewer polygons. Default Mesh LOD settings are configured so that Unity selects a certain LOD when the mesh is at the appropriate size on the screen. In most cases this makes mesh simplification artifacts unnoticeable. The guidelines in this section help mitigate artifacts when they become an issue.
For information on how to view generated LODs and inspect them for artifacts, refer to View generated LODs. When inspecting LODs, consider the size at which they are expected to be rendered on the screen.
Automatically generated meshes appear distorted or display misplaced textures.
For example, the following illustrations display the original model of a tree, the artifacts after generating LODs, and a comparison with LODs authored manually with a similar triangle count.
The original model:
The following close-up of the tree trunk shows that while the automatic generator managed to preserve the shape for LOD2, some clearly visible texturing issues appeared. The image on the right shows a manually authored LOD with a similar number of triangles, which displays the texture correctly.
The following illustration displays a significant loss of detail in the automatically generated Mesh LOD4. For instance, the foliage parts disappear. In comparison, a manually authored LOD with a lower number of triangles has the foliage parts.
The original mesh has high-curvature areas, or sub-meshes with disconnected pieces.
If you encounter such artifacts in Play mode, use the following techniques to mitigate them.
If all LODs in a 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 display artifacts, try reducing the Mesh LOD Threshold value.
If a particular mesh is displaying artifacts, try adjusting per-object LOD settings.
If the quality is good for more detailed LODs (for example, LOD0 - LOD2), but drops significantly at a certain index, use the Limit LODs setting to ensure that Unity does not generate LODs below a certain quality level.
If other approaches don’t help, turn off Mesh LOD generation for a certain mesh and use the LOD GroupA component to manage level of detail (LOD) for GameObjects. More info
See in Glossary feature instead.
Applying blend shape deformations to an LOD mesh leads to unexpected shapes and visual artifacts.
For example, the following model has a blend shape deformation that involves vertices on the edge of the cube.
The next illustration shows the LOD1 mesh generated from the original mesh. The shape is identical to the original one, but the vertex in the middle of the edge is missing. In the initial undeformed state (on the left) this does not cause any issues. When Unity applies the deformation, the shape displays an unintended artifact, because the deformation depends on the missing vertex.
The automatic LOD generator analyzes a static undeformed mesh. It might remove vertices which are not essential in an undeformed state, but absence of which causes artifacts when Unity applies a deformation.
If you encounter artifacts when applying deformation to meshes, use the following techniques to mitigate them:
If the quality is good for more detailed LODs (for example, LOD0 - LOD2), but drops significantly at a certain index, use the Limit LODs setting to ensure that Unity does not generate LODs below a certain quality level.
If other approaches don’t help, turn off Mesh LOD generation for a certain mesh and use the LOD Group feature instead.
The response to lighting on LOD mesh surface does not match the geometry.
The LOD generator does not recalculate normals when simplifying meshes. For example, the following image on the left displays a visualization of vertex normals in the original mesh. The image on the right displays normals in a LOD2 mesh generated with Mesh LOD. The top face has incorrect normals and does not react to lighting as expected.
If you encounter such artifacts in Play mode, use the following techniques to mitigate them.
If all LODs in a scene display artifacts, try reducing the Mesh LOD Threshold value.
If a particular mesh is displaying artifacts, try adjusting per-object LOD settings.
If the quality is good for more detailed LODs (for example, LOD0 - LOD2), but drops significantly at a certain index, use the Limit LODs setting to ensure that Unity does not generate LODs below a certain quality level.
If other approaches don’t help, turn off Mesh LOD generation for a certain mesh and use the LOD Group feature instead.