- Home /
What is the most practical way to convert NPOT textures to POT for an almost finished game?
Some friends and I developed our first game (2D) and did not think about compression while creating the textures for our sprites. So we did not create the textures POT and unfortunately there are many (~200). Consequently the textures cannot be compressed with PVRCT and our OS version of the game is way to big (300MB while the .apk is arround 40MB). What is the most practical way to fix this? Is it possible to automate the conversion? Can i force Unity to convert the textures at reimport? Any suggestion is really appreciated!
I bet the real issue is import settings. Have you gone through all your texture assets and set up their import settings for iOS?
I use Sprite(2D) as texture type. Down at the bottom it tells me "Only POT Textures can be compressed to PVTRC format". If i switch to texture type: advanced i can select NPOT conversion but my sprites will not work anymore afterwards.
Answer by JiMMaR · Jul 02, 2015 at 02:59 PM
for sprites and UI elements.
I managed to reduce the size of the build by using the sprite packer, it's disabled by default but you can enable it from Edit -> Project Settings -> Editor.
You also gotta set the packing tags for the sprites to be packed together in the same Atlas.
by doing this, Unity makes sure that the Atlas is POT
Be aware tho! I recently discovered in our project, that when inspecting the used memory, Unity still used the uncompressed single frames (although the sprite atlas was loaded as well) - at least in animations if they were NPOT. This seems to be a bug and blew up our memory use by almost 300% ! Haven't filed a bug report yet, but will do as soon as I have a demo project! The Unity version we use it 5.4.1 btw.
Answer by smoggach · Jan 13, 2015 at 09:21 PM
You can disregard that warning when building for iOS. If you set the Format to compressed then Unity will use the Max Size to convert your image to POT at that size when you build for iOS. Therefore the most practical way is to let Unity do it.
I don't think there's anything wrong with a 300MB ios file but if you want to provide your own compressed PVR to reduce build size then your option is to create your own spritesheets with an external tool like TexturePacker or cli like ImageMagick. Either way it's going to take a few days to figure out.
Answer by emcx · Jan 22, 2015 at 02:29 PM
I'm having this exact issue. This is pretty ridiculous, tbh, a game using non-POT sprites is really frustrating to build to iOS. You either have to spritesheet all your stuff, reassign textures to everything, rescale stuff if you used different points-per-pixel, etc, OR have uncompressed textures weighing tons and tons of bytes.
Up to this point it has been the biggest hurdle to seamless deployment among different platforms, in my experience.
Answer by virgilcwyile · Feb 29, 2020 at 12:47 PM
Hello, I and my team has made a tool to change the NPOT texture to POT texture. However it's just released, and it's free. It helps in reducing Memory on Android and IOS. Also disk space in your project. Check it out and share it with your fellow Unity developers. http://bluecreazione.com/imageprocessor/
Answer by raiden · Apr 12, 2020 at 02:29 PM
@virgilcwyile Nice tool, too my logo image down from 5.9 mb to 1 mb! Thanks for sharing!