Introduction

8th May 2019 at 5:30pm

Welcome to the docs for the Texture Array Tools editor extension.

Website | Email ([email protected])

This is a small and lightweight asset currently focused on dealing with Texture2DArrays, that so far, as of Unity 2018.3, to quote the Unity docs directly, "do not have an import pipeline for them, and must be created from code, either at runtime or in editor scripts." Naturally, this proves rather frustrating when wanting to fiddle with textures currently bundled in an array, ergo why I made this.

Note that other assets with a similar function can be found on the asset store, and I should've probably checked before making this. Look around and check to see what you like – whilst I can't speak for others, this one is rudimentary. But hey, you can try it out and delete it if it doesn't work for you.

Information of the functionality can be found on the Extracting textures and Merging textures pages. The window is opened from the Tools > Texture array tools menu option.

Extracting textures

18th April 2019 at 3:36pm

One of the two main modes of operation of the tool is the extraction of textures from a Texture2DArray .asset file.

Properties:

  • Array asset: The Texture2DArray asset to unpack. The "Select" button will show you a list of all such assets in your project. The path to the select asset will appear below; if no asset is selected the label will read "No array referenced."
  • Export type: The file type of the exported textures. Can be one of PNG, TGA, EXR, or JPG.
  • Format: The format of the exported textures. Can be one of RGBA32, ARGB32, RGB24, or Alpha8. Information on texture formats can be found in the Unity docs.
  • Extract textures: Clicking this button will extract all textures from the array file into their own files. To perform this action, you must have selected an array. Textures will be saved to an /ExportedTextures directory, a child of your array asset's folder. The destination path is listed in the "Exported textures to:" label (resize the window if necessary).

Merging textures

18th April 2019 at 3:46pm

The other main modes of operation of this tool is the merging of several textures into a single Texture2DArray .asset file.

As the tool itself tells you, textures must be of the same size. The tool will not attempt to verify if that's the case. If you give it textures of varying sizes, it'll presumably either not work properly or throw errors, depending on the order of the textures. Don't do it.

Properties:

  • Textures: A list of textures. Set the "Size" field to as many as you want, then select or drag them in as normal. Whilst textures must be of the same size, their formats need not be the same.
  • Use mips: Whether the resulting array is created with the option to use mip maps. If not set, only the textures themselves will be added to the array. If set, all mip maps of the textures will be added as well. (NB: Whether textures bundled in an array generate mips of their own accord is unknown, but presumed to not be the case. Use this option to copy mips in the array as well.)
  • Encoding format: The format of the textures in the array. Can be one of RGBA32, ARGB32, RGB24, or Alpha8. Information on texture formats can be found in the Unity docs.
  • Choose new destination: Clicking this button will open a "save file" dialog box prompting you to select a target location for your array asset. NB: Due to the way Unity asset serialisation works, you must select a location in your project's "Assets" folder.
  • Merge: Clicking this button will merge all textures into an asset file. To perform this action, you must have selected at least one texture. Textures will be saved to the destination previously specified.