Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Tim-Michels · Jun 19, 2012 at 08:27 AM · importtexturessizemultiplesettings

Multiple texture import settings?

Hi,

I'm working on a project for Android devices. In order to make it runnable on both tablets and mobile phones, I'm going to create 2 seperate builds with slightly different settings.

The only problem is the size of the textures. When I build for tablets, the textures can be imported at their full size, but for mobile phones, I should be able to set them to about half their size.

Now, my question is: Can you have multiple import settings for textures, so I can keep my app in one project. The main idea is to keep it in one Unity project, so when I would have to make changes in the code, I wouldn't have to do this constantly in two projects.

Any thoughts on how I should handle this?

Thanks in advance,

Tim

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Wolfram · Jun 19, 2012 at 10:52 AM

Two possibilities:

  • globally: in the Quality settings, choose/create a different default quality for mobile than for your other builds, and set its "Texture Quality" to "Half Res"

  • per texture: in the Texture inspector, there are pplatform icons to the right of "Default" (just above the "Max Size" setting). Click on your mobile platform, check "override", change Max Size.

(EDIT, before even posting...): Darn, now that I read your question again, you are trying to differentiate between two Android settings. So my second approach will not work. But you can still use my first approach, just switch between "Full/Hald Res" when building for one or the other.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tim-Michels · Jun 19, 2012 at 11:31 AM 0
Share

Yeah, must have looked over that setting in the Quality settings. This is really what I needed.

Thanks

avatar image Tim-Michels · Nov 22, 2012 at 10:54 AM 0
Share

Do you know if I put the texture Quality to "Half Res", if the assets are fully loaded into memory? To clarify my question, if I have an original texture of 1024x1024 and I set the quality setting to "Half Res". (which basically takes the first mip-map) Is the original texture fully loaded into memory, or only the first mip-map?

avatar image Wolfram · Nov 22, 2012 at 11:28 AM 1
Share

Hm, I investigated this a little further, and it seems the "Texture Quality" option really does just enable a lower $$anonymous$$ip$$anonymous$$ap level, ins$$anonymous$$d of using actually a smaller resolution texture. This means:

  • The original texture is still included in the build, even if all Quality settings with "Full Res" are disabled. Therefore your build size will not change.

  • The texture will still be displayed at full res if it has "Generate $$anonymous$$ip $$anonymous$$aps" disabled in its import settings.

  • At least for windows builds, the used memory of the running app is lower, suggesting the full res textures are not loaded. Not sure how this behaves for Android.

So it seems this setting really is a crude workaround. It will not help you reduce the build size, although it might help reducing the memory footprint.

avatar image Tim-Michels · Nov 22, 2012 at 12:07 PM 0
Share

Thanks man, the build size isn't really an issue, but the memory footprint is. Thanks for your help!

avatar image
0
Wiki

Answer by sooncat · Jun 19, 2012 at 10:56 AM

This is my way to solve this problem, need click it every time before build:

 [Menu(.../...)]
 static void set()
 {
 //open editor window here
 }

 void Setting(int diff)
 {
     foreach (string s in allTextures)
     {
         TextureImporter import = AssetImporter.GetAtPath(s) as TextureImporter;
         Texture2D t = (Texture2D)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture2D));
         int max = Mathf.Max(t.width, t.height);
         max = Mathf.NextPowerOfTwo(max);

         import.SetPlatformTextureSettings("Android", max >> diff, import.textureFormat);
         import.SetPlatformTextureSettings("Web"......);
         ......
     }
 }

It's a troublesome thing to click the menu befor build every time.

So I will pay attention to this issue waiting for a clever way.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sooncat · Jun 19, 2012 at 11:12 AM 0
Share

oh, @Wolfram $$anonymous$$resse take the clever way.

avatar image Tim-Michels · Jun 19, 2012 at 11:30 AM 0
Share

Thanks for the sample code, but for my project specifically, setting the textures to half size should suffice. I just wasn't aware of that setting in the quality settings.

Thanks anyway!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Better to use multiple objects or textures with basic paperdolling? 0 Answers

Set Import Setting When an Audio Clip is Dragged into the Project 0 Answers

Disabling mip map turns texture normal 0 Answers

Material tiling on imported fbx model doesn`t fit 0 Answers

Meshes with multpile texture maps--is it possible? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges