# Unity Sprite/Texture Optimization 🖼️ ## Sprite config setting ![](https://i.imgur.com/kU0OlMw.png =300x) 1. Alpha Sources -> Texture 有 Alpha 才需選擇 2. Read/Wite Enabled -> 有需要讀寫貼圖才需要打勾 3. Generate Mip Maps -> 有需要 LOD 才需要勾選 (需要Z軸改變的情形, 若是 UI/normal map 則不勾選) 4. Filter Mode -> Bilinear 5. 除 UI 以外, 解析度都需要為 2N 次方 6. Max Size 根據狀況調整(一般貼圖1024或512,若是icon為64或256) ## Sprite Atlas 1. 使用 Sprite Atlas 將 UI-Sprite 進行打包 ![](https://i.imgur.com/qRBFpKY.png =300x) --- ## Texture config setting 1. 3D 模型的貼圖, Alpha Source 設定為 None (移除不使用的 Aplha通道) 2. Read/Write Enable 取消勾選 3. Generate Mip Map 取消勾選 (若需要遠距離觀看貼圖, 在勾選) 4. Max Size 一般設為 1024(或512), 若需要清楚觀看貼圖細節再設為 2048. ![](https://i.imgur.com/KedWNRz.png =300x) ## Texture compression * Desktop browsers (WebGL) with ==DXT== set as the texture compression format * Mobile browsers (WebGL) with ==ASTC== set as the texture compression format * Mobile devices (IOS/Android) app with ==ECT2== set as the texture compression format ## Crunch Compression If you want to reduce your build size, you may be able to apply another compression pass to your textures. That’s what we call crunch compression. ![](https://i.imgur.com/Gn9TNdD.png =300x) --- * Ref. https://thegamedev.guru/unity-gpu-performance/texture-compression-and-formats/