Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Change saved texture assets' compression type per platform

Discussion in 'Editor & General Support' started by joshuacwilde, Jan 23, 2021.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    263
    I am programmatically creating and saving texture assets (Texture2DArray and Texture2D). They are created in editor of course, but used for mobile. The problem is that in editor they are created as DXT type textures. And of course this doesn't work on iOS. I added some code to compress to PVRTC when switched to iOS platform, but now they won't show in the editor because PVRTC is not supported in the editor.

    How can I have programmatically created texture assets work in both the editor and iOS? Using uncompressed textures is not an option.
     
    Last edited: Jan 23, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    12,114
    Perhaps a custom build step that checks if it is in iOS and reimports those textures in the new format? Then revert them afterwards...
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    263
    Yeah I was thinking about that, but it seems very odd for something that unity should already have built in. Plus it's hard to test as I gotta wait for the project to compile. Which takes a long time.
     
unityunity