ドキュメント

Unity Engine


User Manual

Script Reference

Unity Engine


Image import settings

Apply import settings for Textures, Sprites, and Vector images before you use them as a background for a visual element in the UI Builder.
読み終わるまでの所要時間 3 分最終更新 25日前

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, Sprites, and Vector images before you use them as a background for a visual element in the UI Builder.

Texture

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 2None
CompressionNone
Alpha Is Transparencytrue
Use the following settings for Sprite (2D and UI) Texture types:

Property

Value

CompressionNone
Alpha Is Transparencytrue
Sprite ModeSingle
Mesh TypeTight

Sprites

The recommended import settings for a
Sprite

?

image that you use as a background for a visual element:

Property:

Value:

CompressionNone
Alpha Is Transparencytrue
Sprite ModeMultiple if file contains multiple sprites, Single otherwise.
Mesh TypeTight

Vector images

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 TypeUI Toolkit Vector Image
Gradient ResolutionTexture size used to store gradients
Tessellation ModeBasic Triangulation
Tessellation SettingsBasic
注
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.

Tessellation Mode

The Tessellation Mode determines how the SVG file is converted into a format that Unity can render. The available modes are:
  • Basic Triangulation: This mode provides a good balance between performance and visual fidelity. It uses a simple triangulation algorithm to convert the SVG paths into triangles.
  • Antialiased Arc Encoding: This mode is designed to handle curves more smoothly by using a higher density of vertices along the arcs, resulting in better visual quality for curved paths.

Advanced tessellation

If you want full control over the tessellation of the SVG document, you can specify the following advanced settings:

Property

Function

Step DistanceDistance at which the importer generates vertices along the paths. Lower values result in a more dense tessellation.
Sampling StepsNumber of samples the importer evaluates on paths. More samples can result in more precise curves, especially when the curves have sharp corners.
Max Cord EnabledWhether to enable the maximum chord length constraint.
Max Cord DeviationDistance on the cord to a straight line between two points after which the importer generates more tessellation.
Max Tangent EnabledWhether to enable the maximum tangent length constraint.
Max Tangent AngleMaximum tangent angle in degrees after which the importer generates tessellation.
The following image shows the constraints for the SVG importer:

Max Cord

The importer subdivides curves for as long as every enabled constraint isn't satisfied.
ヒント

Additional resources