When I create a “Landscape” packing tag, the sprite packer usually puts them all in one texture…except, sometimes, it doesn’t. Even when all of the attributes of the images are identical, sometimes it throws one of them into a different atlas. I would like these things to all be put into a single atlas so I can minimize my draw calls and memory usage, but it seems determined not to let this happen.
What am I missing? What settings are used to determine what goes on each “group”?
I’ve included the two groups (the one with a bunch of sprites is “group 0”, the one with only warning lines is “group 1”). As you can see there is more than enough empty space in group 0, and you can see that the import settings for the warning lines are identical to the settings for one of the sprites that IS included in group 0. (Except for the pivot, and if that’s a difference that causes it to be in a different atlas, I’m going to file that one under “Yeah, that’s a bug.”)
EDIT: I’ve figured it out: The warningline were being imported as “RGB” rather than “ARGB”. Is there any way to force Unity to import something as ARGB even if there is no relevant alpha channel (specifically for situations like this)? I opened it up in Photoshop and made a tiny corner of the texture transparent to get Unity to import it that way, but sheesh, that’s a gross hack.
That’s how default packing policies behave. They’re very strict on texture format.
You could write a custom policy which pretends there’s alpha in all textures. Just take code from Unity - Manual: Sprite Packer and change “entry.settings.format = ins.desiredFormat” to convert from RGB to RGBA and possibly other variants you need.
A simpler solution than a custom packer is to change your non-A RGB textures from Sprite to Advanced, then in the dropdown at the bottom of the import settings change to an RGBA format. This worked for me and got things packing really nicely.
this does not really work because the default format changes when you change platforms
so if i change my solid sprites to ARGB32 to fit into the main sprite sheet on the web platform it works fine, until i change to android platform and the default changes to RGBA32 and my solid sprites are left out again
i got it working like this but:
might there be some negative implications for changing a sprite from solid to fake transparent? this is big solid background image so idk
might there be negative implications for changing the texture format of the sprite sheet to rgba32 on all platforms? usually web is argb32?
is there some way i can set it to match the default or current sprite sheet format? web argb32, android rgba32, etc
True @rakkarage - I’m working on android and iOS and they stay consistent on that. If I test on standalone, I get split sheets again. It’s infuriating.
I made a custom Packer Policy (based on the default packer policy on the Unity page) that forces the opaque textures into the transparent atlases.
I only updated it for PC/WebGL/iPhone/Android - so you may need to add others (check which formats are splitting into separate atlases in the Sprite Packer window).
This is the part I added after the texture settings are read: