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 _Adriaan · Nov 10, 2015 at 09:35 AM · texturespritesettingscompressionformat

Black and White compression settings?

Hi there!

I'm making a entirely-black-and-white game which I think could save a lot of memory and GPU power if I would have been able to compress my textures to a format that doesn't have RGB. Preferably I would be looking for a compression that needs 2 bits for the black-to-white color (I think this is called Luminance) and 2 bits for alpha... or something like that?

Does anyone know how to do this, or hack this with the current options?

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
2
Best Answer

Answer by Bunny83 · Nov 10, 2015 at 11:28 AM

Well, the smallest native fromat that can directly be used is ARGB4444 and RGBA4444. It only has 16 bits per pixel. On IOS there's also the PVRTC_RGBA2 format which only has 2 bits per channel and requires 8 bit per pixel.

However if you only need truely black and white and only transparent or opaque you would need only 1 bit per channel and only a grayscale image. So you would have 2 bits per pixel. As far as i know there's no native format that would support this, The smallest adressable unit in a PC is a byte which consists of 8 bits. So you would need to "pack" 4 pixels into a single byte. That means your texture resolution has to be a multiple of 4, otherwise you would have left over pixels. It is possible to store an image in a 2bit per pixel format, but you have to "unpack" it at runtime so the GPU can work with it.

Also you won't save GPU power since the GPU always works with float values. That's what it's optimised for. So it would only save a bit of HDD memory. At runtime in RAM you would need at least 16 bit per pixel if you want alpha as well.

It could be reduced to 8 bit per pixel by encoding the alpha and the B&W bit into a single value. However you would need a special shader to unpack that inside the shader. This would have a problem: You can't use any of the standard shaders since you have to handle your custom format yourself.

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 _Adriaan · Nov 10, 2015 at 07:46 PM 0
Share

Thanks for the answer! Somewhat disappointing that there's currently no solution for me. I guess I'll have to do with RGBA textures then...

avatar image
0

Answer by Jessespike · Nov 10, 2015 at 11:16 AM

Try the Grayscale Image Effect: http://docs.unity3d.com/356/Documentation/Components/script-GrayscaleEffect.html, or use desaturated textures.

I'm not sure if it's possible todo what you're asking. Even if you were to use a custom texture, it probably wouldn't save a lot memory or GPU power as you think.

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 _Adriaan · Nov 10, 2015 at 11:22 AM 0
Share

Thanks for your answer! However, I'm not looking for a way to make my game black and white - it already is! I'm simply looking for a way to compress the textures so that the size of the texture won't me as big in GPU memory as a RGBA texture. $$anonymous$$aybe I am asking too much indeed...

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Texture Compression Confusion For Mobile Games 2 Answers

Texture import settings, Default is "Crunched", but I must also tick override for iOS? 0 Answers

Import Image larger than 2048x2048 1 Answer

If a texture/sprite is NPOT, does Unity still compress it behind the scenes (by converting it to POT)? 0 Answers

After changing my Sprite compression settings for WebGL I got the error "Failed to Create 2D Texture." 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