Search Unity

Bug SpriteAtlas variant with ETC1 alpha not working

Discussion in 'Asset Bundles' started by vizgl, Nov 28, 2021.

  1. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    61
    I made late binding of SpriteAtlas and choose HD or SD atlas depending on GLES version on android device.
    For GLES 3 I use texture options RGBA Compressed ETC2 8 Bits:
    upload_2021-11-28_15-54-20.png

    For GLES2:
    upload_2021-11-28_15-53-59.png

    Code (CSharp):
    1. SpriteAtlasManager.atlasRequested += RequestAtlas;
    2.  
    3. void RequestAtlas(string tag, Action<SpriteAtlas> callback)
    4. {
    5.         if (QualityAdoption.IsLowEndDevice)
    6.             quality = "_SD";
    7.  
    8.         var sa = Resources.Load<SpriteAtlas>( $"Atlases/{tag}{quality}");
    9. }
    When I run game on low end device and sd atlas loaded, flag ETC1_EXTERNAL_ALPHA is not enabled and all my sprites doesn't support alpha channel. But if I set texture format to RGB ETC 4 bits on the Master atlas, then even SD atlas loaded it is support external alpha texture.

    So as I understand, keyword ETC1_EXTERNAL_ALPHA is choose only from master atlas, even if variants must support it.