Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

TextureImporter Recommendation

Discussion in '5.5 Beta' started by sstrong, Nov 11, 2016.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    As 5.5 no longer supports textureFormat, what is the recommendation for converting the following code?
    Code (CSharp):
    1. textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
    It isn't clear from the limited documentation if the following was correct.

    Code (CSharp):
    1.                 #if UNITY_5_5_OR_NEWER
    2.                 textureImporter.textureCompression = TextureImporterCompression.CompressedHQ;
    3.                 #else
    4.                 textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
    5.                 #endif
    I'm not sure if I should be using Uncompressed, CompressedHQ or some other coding strategy altogether.
     
  2. Julien_Unity

    Julien_Unity

    Unity Technologies

    Joined:
    Nov 17, 2015
    Posts:
    72
    Hi,

    The new compression setting works pretty much like the old "auto" mode.
    Basically:
    AutomaticTrueColor => TextureImporterCompression.Uncompressed
    AutomaticCompressed = > TextureImporterCompression.Compressed.

    CompressedHQ/LQ are here to offer a wider range of formats for platforms that support them. For example, on PC Compressed will be DXT1 or DXT5 like before and CompressedHQ will use BC7. The full list of formats mapped to the various compression setting will be available in the updated documentation.

    Hope this clears things up!
     
    zaxiastudio, levlaj and sstrong like this.