Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bad results with Android texture compressions

Discussion in 'Editor & General Support' started by jordansaia, Nov 27, 2015.

  1. jordansaia

    jordansaia

    Joined:
    Jul 18, 2014
    Posts:
    16
    Hi everyone!

    So, I am in the midst of wrapping up my first mobile game called Vortek
    info and gameplay video will be linked at bottom of post.

    I've read that when outputting to android for 2D games it is best to use no texture compression when making an apk build. I tried this and it plays, but now the graphics all look stepped and very pixelated.
    When I output in Terga compression it looks beautiful.
    However the big problem is that when I put it on the google play store:

    No compression - 10,000+ compatible devices!
    Terga - 900 compatible devices :(

    How can I get the graphics to look great and up our games compatibility?

    Thanks for any help!
    FREE version of game here:https://play.google.com/store/apps/details?id=com.saia.vortekfree

     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Uncompressed should look great, if it looks "stepped" and pixelated, something is wrong.

    Screenshots?
     
  3. jordansaia

    jordansaia

    Joined:
    Jul 18, 2014
    Posts:
    16
    Terga:
    Screenshot_2015-11-27-17-31-27.png

    Uncompressed:
    Screenshot_2015-11-27-18-11-07.png

    The images used for the scrolling background in the levels is also fragmenting


    Terga:
    Screenshot_2015-11-27-17-31-49.png

    Uncompressed:
    Screenshot_2015-11-27-18-12-10.png

    The scrolling files are all png and used as textures
    the background for the menu screen is a png sprite

    nothing changed between builds

    any ideas?

    oh and in the scene for the menu the little dude is animated, 5 frames and there is a particle effect spawning of screen to make a leaf blowing effect.
    not sure why this would effect the background though..
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    So, Android, as a platform, is a mess - the spec for android devices using openGLES2.0 only required ETC texture compression, which doesn't support alpha channels. On top of this, each graphics chip vendor added their own compression formats (ATC, ATSC, DXT, PVRTC, ETC2).

    So, if your running Unity 5.1 or less, Unity will take compressed RGBA textures and turn them into 4444 textures, which is why you see all the banding. On Unity 5.2, it compresses them into ETC2 textures, which are only available on openGLES3.0 devices - and on 2.0 devices, it converts them into RGBA32 textures at runtime (which are huge).

    Unity 5.2 also added a feature for sprites that compresses your alpha textures into two ETC textures, one for the color and one for the alpha channel - so that's also an option.

    You can also override the texture compression options at build time and force a specific compression format; we actually do this when we build asset bundles, and build one copy of the bundles for each texture format, then look at the GPU to figure out which one to download at load time.
     
  5. jordansaia

    jordansaia

    Joined:
    Jul 18, 2014
    Posts:
    16
    thanks for the info!

    so I am downloading 5.2 right now.

    what would you recommend I do to avoid this issue?
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Like most things, it's a mess of tradeoffs.

    If you want ease of development and high quality, go uncompressed textures - but your not going to run on low end devices without a lot of memory.

    If you want optimal compatibility with best memory/performance, build textures for each platform in asset bundles or obb files and load accordingly - but be prepared for long build times and lots of texture compression, etc.

    If all you need is sprites with RGBA textures, then the dual-ETC texture option will likely be a big win for you. That gives you most of the benefits but with only slightly larger memory footprint and an extra sample per shader.
     
  7. jordansaia

    jordansaia

    Joined:
    Jul 18, 2014
    Posts:
    16
    so if i want to go uncompressed do I need to adjust the API to avoid the banding?
    Or does 5.2 take care of it?

    EDIT: looks like I got it working with 5.2! Thanks!!
     
    Last edited: Nov 28, 2015
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    uncompressed shouldn't have banding. In <5.2 unity, any texture format not supported natively got unpacked into a 4444 texture. In 5.2+, they get unpacked into a 8888 texture - which while much better quality, is twice the memory (of a 4444) and roughly many times larger than it's compressed counterpart (I think ETC2 is 12:1 off the top of my head)