Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 LeleUnity · Sep 02, 2017 at 11:47 AM · bugoptimizationtexture2dsizememory

Texture Doubled in size in RAM Profiler

As you can see, the texture is only 5.3 mb but at runtime is referenced twice as Material instance and material prefab and it take double of the size! It is really a lot of memory! What can I do for reduce this memory consumption? I have already compressed to 8 bits. what else? thank you!!

alt text

screenshot-2.png (224.2 kB)
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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by TheSOULDev · Sep 02, 2017 at 03:43 PM

First you have to ask yourself if you really need a 2048x2048 texture - I can see that it is not a particularly detailed one, especially if you set it to 8bit. Secondly, you should crop the black space you don't need - in your case, it is well above half the texture. Also, I'd advise you to use DXT5 compression as it looks better than ETC2, saves space, and is faster.

There was someone with something like a 13000x4000 texture who had 120MB of RAM taken per picture, and by cropping it it dropped to 5MB or something like that, so there's that.

Comment
Add comment · Show 6 · 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 LeleUnity · Sep 02, 2017 at 05:35 PM 0
Share

The problem is not the compression. The problem is WHY it is doubled in memory !!

avatar image LeleUnity · Sep 02, 2017 at 05:52 PM 0
Share

and As per your information : DXT5 didn't change at all the size. Secondly, If I cut the transparent part the background will not be squared and it will increase in size and not decrease as one could think, since Unity prefers squared textures to compress.

But this is out of the question. WHY in memory it is doubled ? I reach easily 100 mb.

avatar image LeleUnity · Sep 02, 2017 at 05:56 PM 0
Share

DXT5 compression didn't enhanced anything. Just Crunch compression of course works, but that is another story.

alt text

screenshot-6.png (53.2 kB)
avatar image TheSOULDev LeleUnity · Sep 02, 2017 at 09:16 PM 0
Share

When texture decompression is not supported on a device, Unity unpacks it to a 32-bit RGB, which pretty much doubles it in memory. Also, if you don't want to crop it, then you should at least resize it. The texture you have doesn't look like something that needs a higher res than 1024x1024. If you have details that are not visible on the picture, it would be way better to use smaller sprites for that. Your texture is pretty much a 3 color texture without any significant detail. You're wasting too much space and resolution for something that isn't really detailed, or at least not visibly. If those extra 5 $$anonymous$$B are a problem, then you should have already attempted to make it a 1024x1024 texture. If the quality loss is unbearable, which it shouldn't be, just apply AA to the edges. Also, if you turn mipmapping off, you can free around 2.3 $$anonymous$$B.

avatar image LeleUnity TheSOULDev · Sep 02, 2017 at 10:15 PM 0
Share

Excuse me, but you didn't get the point of the question. The Point is that: 1) a background is allocated in memory EVEN if is NOT in the scene and EVEN if is not under any Resources folder.

2) Disabling mipmaps just reduce a bit. The size of the file is 4 $$anonymous$$B, In memory however becomes 10$$anonymous$$B (with mipmaps) and 8.3 mb (without mip maps) so it is always doubled. alt textalt text

screenshot-11.png (208.2 kB)
screenshot-10.png (204.6 kB)
Show more comments
avatar image
0

Answer by Bunny83 · Sep 02, 2017 at 05:53 PM

You generated mipmaps. They don't require the same space as the full texture but at least half the full size. Since for performance reasons textures are almost always stored with a power-of-two size, it means at least one side would be doubled.

Comment
Add comment · Show 1 · 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 LeleUnity · Sep 02, 2017 at 10:17 PM 0
Share

Excuse mealt text, but you didn't get the point of the question. The Point is that: 1) a background is allocated in memory EVEN if is NOT in the scene and EVEN if is not under any Resources folder.

2) Disabling mipmaps just reduce a bit. The size of the file is 4 $$anonymous$$B, In memory however becomes 10$$anonymous$$B (with mipmaps) and 8.3 mb (without mip maps) so it is always doubled.

Please watch the screenshot carefully.

alt text

screenshot-11.png (208.2 kB)
screenshot-10.png (204.6 kB)
avatar image
0

Answer by LeleUnity · Sep 02, 2017 at 10:31 PM

I noticed this. It might be a clue. Someone can explain it ? I am using this texture on a simple quad where it is offeset giving the illusion of infinite repeated background. I notice the voice: "Material prefab" as well as "Material instance". Both I believe occupy 4mb. But WHY this happens? alt text


screenshot-14.png (35.3 kB)
Comment
Add comment · 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

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

80 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Are Texture2Ds in a Resources folder always loaded in memory? 1 Answer

Texture and Texture2D for GUI (simple question) 1 Answer

Why does a 1024*1024 Texture2D use so much memory? 2 Answers

how do you destroy a texture2d array ? 3 Answers

How to reduce Mixamo animation size? 0 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