We’re working on a project with massive sprite atlases for multiple platforms. We’re actually using SpriteAtlasV2, which has been really nice to work with so far.
But in order to get different sized atlases for different platforms, we have to jump through a few hoops that exist in both V1 and V2. Right now, we have “Sprites-[name]-MASTER”, “Sprites-[name]-Mid” and “Sprites-[name]-Small” for all of our ~150 (and growing) 8K atlases. As the name implies, “-Mid” uses 50% scale and “-Small” uses 25% scale.
Our build process finds all of our SpriteAtlases and enables/disables them based on platform and the atlas’ naming convention. Not very elegant.
It seems like it’d be much more intuitive for this option to exist in the platform-specific import settings, rather than juggling the “Include in Build” toggle. Currently, I can change the size of the atlas, but that doesn’t change the actual pixel density of the imported asset. (I can’t even really think of a use for the existing “max texture size” on atlases, other than device texture limits.) For example, being able to set my Switch platform sprites to either “50%” or change the max size of the output texture to “4096” is what I’m talking about.
It’s worth mentioning that using late binding (as I understand it) would be extremely tedious, since we’d have to have a behavior on every single sprite in the game that late-binds the sprite renderer… not very sustainable.
Can you get there by using QualitySettings for that platform and setting Texture Quality settings to some custom level for that target? I think that only applies to mipped textures, and I’m not sure how it would apply to a Unity-generated atlas, if you’re using those.
I think that will just mean the renderer will only use the lower mip; but it still gets loaded, and definitely put in the build (since the Quality Settings can be set via scripting at any time). But even if this worked, I would want to apply this to our environment textures, but not our UI textures (since UI needs to show up bigger on smaller devices).
Normally, for 3D games, we tend to do a pass through all textures, changing the “Max Texture Size” down to a reasonable amount for certain platforms. But since “Max Atlas Size” does not actually change the pixel density of the output atlas, that doesn’t currently work.
I might have misunderstood the question, but isn’t this what atlas variants are for? You start with your 8K atlas, then create a variant at 0.5 scale so it outputs a texture size of 4k? I guess it doesn’t really solve your ‘Include in build’ problem (since you would still have to go through and select your correct variants), but it would at least mean you only have to include your sprites in one sprite atlas (I assume right now when someone adds a sprite or folder they have to remember to include it in all atlas sizes).
Ah, I didn’t specify but we are indeed using Variants. It’s just that the need to search through the project and turn them on or off (in code, of course) that seems like an unnecessary step, but maybe it’s a Unity innards complication?