Search Unity

New Sprite Atlas and Asset Bundles -- Not playing nicely together?

Discussion in 'Editor & General Support' started by HiddenTess, Jul 20, 2017.

  1. HiddenTess

    HiddenTess

    Joined:
    Jan 7, 2016
    Posts:
    21
    I'm trying out the new Sprite Atlas feature in 2017.1.

    Is there some trick to putting a Variant Sprite Atlas into its own Asset Bundle, without a dependency on the bundle containing the Master Sprite Atlas? I can't seem to get this to work at all. Every one of my asset bundles containing a Variant Sprite Atlas claims that it is dependent upon the bundle containing its respective Master Sprite Atlas. I am really baffled by this, because it would seem to severely diminish the usefulness of Variant Sprite Atlases.

    Has anyone gotten this to work properly?
     
  2. HiddenTess

    HiddenTess

    Joined:
    Jan 7, 2016
    Posts:
    21
    I have attached a minimal project where I've reproduced the problem (and several others). Problems demonstrated in this project include the following (copied from the README.md in the included package):
    1. When I originally tried to implement this same test using variant asset bundles (with the `hd` and `sd` extensions), Unity kept loading the full-size sprites, somehow. I haven't seen this same behavior in my larger project, so this surprised me. This is why I switched to using different Sprite Atlas names, and different bundle names.
    2. If you switch the Variant Sprite Atlas to a scale of 0.3333 (or a variety of other sizes other than 1/2, 1/4, 1/8, etc.), it will produce an NPOT Texture Atlas. It would probably be preferable to re-fit the art in a POT Atlas.
    3. If you peek inside of `StreamingAssets/AssetBundles/sdsprites.manifest`, you can see that the SD asset bundle thinks that it has a dependency on the HD asset bundle. For obvious reasons, I do not want to load the HD asset bundle before I load the SD asset bundle.
    4. The SD asset bundle somehow ends up larger than the HD bundle. This is still true, even if I drop the variant Sprite Atlas down to 1/8 of the original art size. In my larger project, my half-size SD bundles are smaller than the HD ones, but not by much. For instance, I've got a 29MB HD asset bundle with a half-size variant that's 26MB. What the hell is taking up all that space in the SD-bundles?
    5. When switching to the Variant sprite atlas, the UVs for the sprites are very clearly wrong. They appear to be using the pixel sizes and locations of the sprites from the Master sprite atlas, instead of making these fit the variant atlas. This makes variant atlases not very useful! I saw at least one other person complain about this, somewhere, so I am definitely not the only person having this problem.
    The package includes instructions on how to build the asset bundles and test things out in the README.md.

    I am interested in whether anyone has gotten variants to work properly.
     

    Attached Files:

  3. rejemy

    rejemy

    Joined:
    Nov 1, 2013
    Posts:
    13
    Running into this same issue, just bumping this in case anyone has some new information on this issue. Until then, it seems like maybe the workaround is to not use atlas variants, but that means I have to build HD and SD versions of every atlas from HD and SD source images, which is not ideal.
     
  4. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Is this solved in newer Unity versions?
     
  5. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    still not fixed :/