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. Dismiss Notice

ETC1 Alpha channel compression

Discussion in 'General Graphics' started by TimGS, Oct 13, 2016.

  1. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    70
    Hello, friends
    I'm kinda confused because of some problem that appeared.
    I was using RGB ETC1 4bit textures with split ETC1 aplha (by ticking the option below) without any problems. But now when I added another texture and tried to compress it, I got strange results. No alpha in texture just artifacts instead looking like lines:
    preview_bug.PNG
    And it should be like this:
    preview_nobug.PNG
    I checked my settings and they were fine:
    settings.PNG
    So the problem is somewhere else.
    So I checked my older textures which I compressed that way before and I found them showing another format in their settings: RGBA ETC2 8 bits! Why is that? When was that changed? I don't know.
    I don't want to waste my time reinstalling previous versions of Unity one by one and checking which one broke everything.
    So if anyone knows why is this happening, I'd like to hear from you.

    Saving ETC2 8 bit RGBA destroys the whole purpose because I need ETC1 with alpha not ETC2.

    I'm using 5.4.1p4 now, I already checked 5.4.0f3 and it's the same there.
     
  2. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    have you tried pre-multiply your RGB channel and making an alpha channel?
     
  3. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    70
    The source is PSD file so yes I'm sure, everything is there , I checked
    And also, it worked before. I just don't know the version it stopped working.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    Have you checked if it works on device, and just looks wrong in the editor?
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Also, did you check the "Alpha is transparency" checkbox?
     
  6. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    70
    Yes, it's checked.

    I've created a small test project with a simple texture, which demonstrates this strange Unity behaviour.
    Editor and device show the same:
    testTexture.PNG
    The left plane uses RGBA ETC2 8 bit texture and the right one uses ETC1 4bit with option "Compress using ETC1 (split alpha channel)" turned on. Actually I don't see any changes by turning this option on and off while texture type is "Advanced". Texture transparency looks correct in texture type "Texture" and this option on but Preview says it's RGBA ETC2 8bit.

    So my questions to Unity team are:
    Does this option being on save texture as ETC1 or not?
    And if it does then why it doesn't work in Advanced mode?
    And why preview window says it's ETC2 when it's on and texture type is "Texture"?
     

    Attached Files:

  7. StenCG

    StenCG

    Joined:
    Mar 26, 2015
    Posts:
    63
    I found out, the checkbox "etc1 alpha split" works for Atlas, but UI/Default shader not have fallback to UI/DefaultETC1, so you need to add it ourselves, then it will work for UI elements.