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 OperationDogBird · Sep 30, 2012 at 09:58 PM · textureloading textures

Get the original size of a texture

Im loading textures from the resources folder. When i check the width and height of the textures the output is 128x128. The original size of the textures are 150x120. How can i get the original size of the texture when loading them this way?

Comment
Add comment · Show 3
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 landon912 · Sep 30, 2012 at 10:53 PM 0
Share

Unity does its own "optimizing"

avatar image Eric5h5 · Oct 01, 2012 at 12:28 AM 0
Share

@landon91235: No, it uses whatever settings you tell it to use.

avatar image numberkruncher · Jan 07, 2013 at 08:50 PM 0
Share

Please see my hack (http://pastebin.com/J6wqU8ax) and consider voting here: http://feedback.unity3d.com/unity/all-categories/1/hot/active/get-original-width-and-height-of

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SarperS · Sep 30, 2012 at 10:56 PM

In the import settings, set the "Non power of two" option to "None" and Unity will import them in their original sizes. Then you can get them that way. Warning though, you won't be able to compress them into PVRTC if they are NPOT.

Comment
Add comment · Show 3 · 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 OperationDogBird · Sep 30, 2012 at 11:52 PM 0
Share

I set the npotscale to none and isreadable via code and the output is still the same: 128x128. If i try to manually Resize the texture it says it is not readable.

I checked the importer settings and the importer does get set to npotscale : none and read/write flag is set to true. Any ideas here?

avatar image Eric5h5 · Oct 01, 2012 at 12:29 AM 0
Share

Click "apply" after changing the settings.

avatar image OperationDogBird · Oct 01, 2012 at 01:31 AM 0
Share

@eric5h5 im doing the changes via code in an editor script, i dont see an exposed property or method for Apply() in the TextureImporter. The changes seem to be applied automatically. The changes do show up in the texture importer via the inspector.

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

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Loading in textures dynamically without using Resources 1 Answer

Assigning UV Map to model at runtime 0 Answers

Effects to make space seem far away 1 Answer

Shader light fix? 1 Answer

Change GUI.Button Texture on runtime 1 Answer


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