After you have imported an image to your project, for the most intuitive results, it’s recommended that you apply certain import settings for Textures, SpritesA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
See in Glossary, and Vector images before you use them as a background for a visual elementA node of a visual tree that instantiates or derives from the C# VisualElement
class. You can style the look, define the behaviour, and display it on screen as part of the UI. More info
See in Glossary in the UI Builder.
The recommended import settings for a Texture image that you use as a background for a visual element are as follows.
Use the following settings for Default Texture types, and Editor GUI and Legacy GUI Texture types:
Property | Value |
---|---|
Non-Power of 2 | None |
CompressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression. See in Glossary |
None |
Alpha Is Transparency | true |
Use the following settings for Sprite (2D and UI) Texture types:
Property | Value |
---|---|
Compression | None |
Alpha Is Transparency | true |
Sprite Mode | Single |
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 Type |
Tight |
The recommended import settings for a Sprite image that you use as a background for a visual element:
Property: | Value: |
---|---|
Compression | None |
Alpha Is Transparency | true |
Sprite Mode | Multiple if file contains multiple sprites, Single otherwise. |
Mesh Type | Tight |
When you import a vector image, Unity generates a VectorImage asset. You can then use this asset in your UI. The VectorImage asset is a lightweight representation of the SVG file that Unity can render efficiently.
The following are the recommended import settings for a SVG Vector image that you use as a background for a visual element:
Property: | Value: |
---|---|
Generated Asset Type | UI Toolkit Vector Image |
Gradient Resolution | Texture size used to store gradients |
Tessellation Mode | Basic Triangulation |
Tessellation Settings | Basic |
Note: When you use Basic tessellation settings, you only need to provide a Target Resolution (use the lowest value that produces satisfactory results) and a Zoom Factor. The importer then automatically configures the advanced settings to ensure your SVG document renders at a high enough tessellation for that resolution at that zoom factor.
The Tessellation Mode determines how the SVG file is converted into a format that Unity can render. The available modes are:
If you want full control over the tessellation of the SVG document, you can specify the following advanced settings:
Property | Function |
---|---|
Step Distance | Distance at which the importer generates vertices along the paths. Lower values result in a more dense tessellation. |
Sampling Steps | Number of samples the importer evaluates on paths. More samples can result in more precise curves, especially when the curves have sharp corners. |
Max Cord Enabled | Whether to enable the maximum chord length constraint. |
Max Cord Deviation | Distance on the cord to a straight line between two points after which the importer generates more tessellation. |
Max Tangent Enabled | Whether to enable the maximum tangent length constraint. |
Max Tangent Angle | Maximum tangent angle in degrees after which the importer generates tessellation. |
The following image shows the constraints for the SVG importer:
The importer subdivides curves for as long as every enabled constraint isn’t satisfied.
Tip: