Search Unity

Using Texture2DArray asset on multiple platforms

Discussion in 'Editor & General Support' started by Peter77, Aug 31, 2017.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I'm trying to understand how to use the same Texture2DArray asset, but with a different texture format, depending on the target platform.

    There is no import pipeline in Unity for Texture2DArray assets at this point in time, like for any other Texture, where I can simply specify the texture format for each target platform.

    According to the documentation, we currently have to copy texture data to a Texture2DArray ourself and save it as an asset via editor scripting.

    If I create a Texture2DArray and save/bake it using format=DXT5, how can I change the texture format afterwards, for example to format=PVRTC if I build for iOS?!

    Since Unity does not expose a setting in the Texture Inspector where I can specify the texture format for each platform, the saved/baked Texture2DArray seems to stay in DXT5 format forever.

    How do you handle this case? The only approach I can think of is to bake the Texture2DArray every single time before building for a specific platform and/or when switching the platform inside the Unity editor.
     
    Last edited: Sep 1, 2017