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 Catlard · Jul 02, 2014 at 05:50 AM · androidtexturememorycompression

Alpha 8 to save Texture size?

Hi!

I'm working on an app for android and iOS. Memory and texture sizes are a problem -- whenever the app goes into the background, it has to restart, because Android kills the process (it takes up too much memory), so I'm looking at alternate ways of storing the textures in memory. I came upon an idea.

I'm working with a texture that is 1024 x 238. At RGB24, it's 1.7mb. If I switch the compression to Alpha 8, it shrinks down to 446kb. Huge drop! It's ok, too, because the texture is only white and alpha. So technically, no data has really been lost. However, The white that was in the image is now black -- and I can't seem to figure out a way to tint it (back to white). So, two questions:

1) How do you tint a texture that is in alpha 8 format? Is this possible? I'm working with UITextures in NGUI, if that helps. 2) Is this really going to save on the texture's size in memory?

Cheers,

Simon

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by gstock · Jul 02, 2014 at 06:59 AM

Verify that the "Alpha is Transparency" setting is set on the texture file on the inspector. Also, you should check that the material that your object uses has a shader that supports transparency.

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 Catlard · Jul 02, 2014 at 07:27 AM 0
Share

Thanks for your answer...but Alpha is Transparency doesn't seem to affect it...

avatar image
0

Answer by Japa · Jun 30, 2015 at 12:55 PM

Alpha8 means that is only stores alpha, nothing else. This means that the white of the main texture is lost.

The only way I would use an Alpha8 texture (And I plan to, actually) is from a shader set to specifically use it.

If you write a custom shader that just uses a color and the alpha map from a texture, then you can use an Alpha8 texture.

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

Answer by spalmer · Jun 30, 2015 at 04:32 PM

Unity needs grayscale image compression format options. Alpha8 isn't quite a drop-in replacement for the functionality we need. If you select the Alpha from grayscale option it will get you partway there, then you must take the shader you would have used and change it to read its color from the alpha channel instead of rgb. It's probably more trouble than it's worth.

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

Answer by Earlybird · Mar 11, 2017 at 08:14 AM

You need a shader that uses the alpha 8 texture for alpha only and tint the albedo with _color only.

So the output would be something like this

 O.albedo = _color.rgb;
 O.alpha = _Maintex.a;

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

25 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

Related Questions

How to find what texture compression was forced for build? 1 Answer

Default Texture Platform/Format settings 2 Answers

Failed to generate ETC texture UnityEditor.HostView:OnGUI()...Why? 0 Answers

garbage collection not cleaning up material that isn't referenced on android 1 Answer

Low Memory Crash on iPad1 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