Getting Started
Package Types
Scene Setup
Economy
Scripting
Components
Guidelines
Support
Background
Spatial Unity SDK > Editor > Scripts > Utilities > AssetImportUtility.cs
Released version: 0.67.0 (July 12, 2023)
- Spatial spaces experience app crashes on mobile devices due to high memory usage.
- Room loading time is influenced by the room size.
- By adjusting the compression settings, the size of the room can be significantly reduced. This import utility is expected to reduce the room size by over 50%.
Important Information to Consider
Texture Formats for Different Platforms
Each platform has its own supported texture formats, allowing you to optimize your project based on specific platform requirements. When selecting a texture, you have the ability to override the default format for each platform. If you haven't made any custom settings, the Creator Toolkit will automatically enable the recommended format for optimal performance.
Recommended Texture Formats
- ASTC (Adaptive Scalable Texture Compression) is widely regarded as the best texture format for mobile devices due to its high-quality output and efficient compression rate. ASTC supports different compression sizes, and we recommend using ASTC8x8 as the primary option. If you find the quality is not satisfactory, you can experiment with ASTC6x6 or ASTC4x4. However, keep in mind that ASTC4x4, while maintaining image fidelity, results in larger file sizes.
- However, for WebGL, the DXT (Block Compression, BC) format is recommended. Although Unity WebGL offers ASTC options in the format list, they are specifically intended for mobile browsers, and Spatial does not support mobile web. Using ASTC formats in WebGL will cause Unity to convert the textures during loading, resulting in significant loading times.
For a 1024x1024 texture with mipmaps:
ASTC4x4: 1.3mb ASTC6x6: 0.6mb ASTC8x8: 341.4kb
Crunched DXT provides a good compression rate despite lower quality, making it a preferred choice for WebGL. The reduced file size translates to shorter loading times, improved performance, and reduced app crashes. If Crunched DXT produces noticeable artifacts, especially in lightmaps, you can consider using Compressed DXT for better quality. (But it may increase the texture size by 3~4 times.)
DXT1 is for RGB textures. If the texture contains alpha channel, then DXT5 should be used as it supports the alpha data.
Details
How the utility works
If asset import settings have already been configured previously, the utility will not make any changes. Therefore, if the default settings applied by the utility are not satisfactory, you have the option to modify the settings manually.
Imported Assets from AssetStore
When importing assets from the Unity AssetStore, the utility will not modify the settings as they have been preconfigured. If the settings are set to high quality or poorly optimized, it can result in a larger file size for the environment. To address this, you can manually adjust the settings using the buttons available in the Utilities tab of the Spatial Portal.
- The "Optimize Assets" button will modify the import settings for all assets in the project.
- The "Optimize Assets (Folder)" button will modify the import settings for assets located within the selected folder.
Feel free to use these manual optimization options to adjust the import settings as needed for your project.
← Previous