- Home /
How do I downsize all textures for mobile version?
I have a game that uses assets designed to work at 4k and it looks awesome. Made a copy of the project and converted the copy to Android. Compiled and installed on tablet, but it crashes. Doesn't tell me anything, just fails during the loading. Since there's no logging or any way to tell what's crashing it, I'm going to assume it's just too much graphics for the memory.
Now I know I can select a texture, and reimport it, using a lower max resolution (some of these are 2048), but how can I do that across the board for all of the textures in the game. Searching for "t:texture" gets them all, but I can't select all and reimport, and all of them aren't at the same type or textures resolution.
I am trying to avoid having to write an editor add-on that will reimport each texture asset at 1/2 to 1/4 it's current resolution, if someone can give me any suggestions?
Answer by SarperS · Jun 23, 2016 at 04:53 AM
There is logging and there are ways to tell what's crashing. Log your game on your tablet using logcat.
http://answers.unity3d.com/questions/492681/how-to-use-adb-logcat.html
As for your other question, go to your texture's import settings, go to the Android tab, toggle Override for Android, and change the maximum texture size.
But isn't that done "per texture?" I'd rather not have to do this for thousands of textures, and I can't multi-select because they're not all the same size, type, and resolution. Saschandroid seems to be on to something.
But I do like your advice for debugging. Will have to look into that. Had been just building and copying over apk's, but really need to run it directly on the tablet I plan to use and look at the debugging.
Have a look at this script, I use it on all my projects, it changes the default import settings of the assets. You can customize the settings in the script to your liking, select all your textures (by searching for t:Texture2D in the project window), right click on them and re-import them. It would take some time but also change all the texture settings based on your preferences. Also from that point onward, whenever you add a new texture, it would come with your pre-defined settings for every different platform in the script.
http://www.sarpersoher.com/a-custom-asset-importer-for-unity/
Although your script is useful ... I guess what he actually wants, is to have each texture to be (for example) half it's size (4096->2048, 1024->512, 512->256, ... ). If you set the maximum import size for android let' say to 1024, all textures above 1024 get resized and none of the textures with 1024 or less. I may be wrong, but I think he wants these small ones to be resized too.
Answer by saschandroid · Jun 23, 2016 at 06:57 AM
Instead of re-importing the textures you can try to lower the graphics quality for android. Go to Edit->Project Settings->Quality and change the Texture Quality for all Quality Levels from Full Res to Half, Quarter or Eighth Res.
Trying that. It sounds like what I need. If you report this as an answer, I think I can mark this the correct answer.
Ok, so I tried this, dropping it to Eight Res, and the app still did not run. Not sure if this is what I needed, but it seems like it's on the right track.
Answer by DanishSinha · Aug 20, 2017 at 03:01 AM
Use the memory profiler and check your memory allocation maybe it is crashing because of high memory allocation.
Your answer
![](https://koobas.hobune.stream/wayback/20220612083458im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Sprite Black on mobile - Resolution problem 2 Answers
Texture looks low-res/chunky/pixelated on mobile 3 Answers
Mobile device screen resolution 1 Answer
Unity 5.3 canvas scaling - Android 2 Answers
Android Unity3d - create a mesh object with movement 0 Answers