TextureImporter Recommendation

As 5.5 no longer supports textureFormat, what is the recommendation for converting the following code?

textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;

It isn’t clear from the limited documentation if the following was correct.

                #if UNITY_5_5_OR_NEWER
                textureImporter.textureCompression = TextureImporterCompression.CompressedHQ;
                #else
                textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
                #endif

I’m not sure if I should be using Uncompressed, CompressedHQ or some other coding strategy altogether.

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!

3 Likes