2D Toolkit Forum

2D Toolkit => Support => Topic started by: TekuStudios on July 23, 2013, 07:19:04 pm

Title: An incredibly noob question cencerning atlases
Post by: TekuStudios on July 23, 2013, 07:19:04 pm
Hi there again.

We are trying to compress as much as we can every single image of our game to keep it running at 60fps. We have compressed the original PNG files a lot, and a little more using the Posterize option of Photoshop (with the appropriate setup), and we have updated all our collections with the new reduced images.

After doing that, we've checked out the new atlases of the collections, and all them weigh the same as before! So then every single level has exactly the same size to load? How does exactly the atlases work? Even if an atlas is the same size as before, if the images it contains are lighter, shouldn't it be lighter too? We are a little lost on this subject.

Thanks for your time.
Title: Re: An incredibly noob question cencerning atlases
Post by: DannyB on July 23, 2013, 08:14:09 pm
The source images you feed into the atlases have no influence on the result, as Unity processes these textures.

Your way to influence the weight of the atlas is by opening the collection editor, and selecting the texture type (True Color, Compressed, 16 Bit Reduced).

But dont get your hopes up.
Compressed gets usually terrible results. You can get away with it for backgrounds.
16 bit works well if you dont have detailed gradients.
But for most things, I find myself using True Color, if you want things to look sharp.

Title: Re: An incredibly noob question cencerning atlases
Post by: TekuStudios on July 23, 2013, 08:34:59 pm
Yeah, we are dealing with Compressed/True Color, but we hoped to find another compression way to reduce even more the weight of each atlas.

Thanks for your answer.
Title: Re: An incredibly noob question cencerning atlases
Post by: DannyB on July 23, 2013, 08:40:29 pm
You and me both...
To me it was a very frustrating realization that for iOS - my primary target platform - you only deal with those extremely useless PVRTC compressed textures.

The only other good trick I can tell you works great, is the sprite dicing in the collection editor.
This way you can save more space per atlas, especially when you have non rectangular images or big images.

Besides that, its a balance of weight vs. quality.
Title: Re: An incredibly noob question cencerning atlases
Post by: unikronsoftware on July 23, 2013, 10:07:54 pm
What are you trying to save here? Disk space? VRAM?

If you cared about VRAM usage, you don't have much choice but to use PVRTC / DXT textures. In my experience DXT isn't generally as horrible as PVRTC, but still very noticable.

On the other hand if you weren't too bothered about VRAM usage, but cared more about disk space, there is one more fairly viable option - keep the atlas images as PNGs. I had a user contribution for this, but not had the chance to integrate completely + test all possibilities. This will trade of some additional main memory & load speed, for a massively reduced disk footprint.

Vote for it on the trello if you'd like it implemented sooner :)
https://trello.com/b/UfqlXqXy/2d-toolkit-roadmap

This isn't a complete solution to solve everything though - ultimately, you're making some pretty serious trade-offs, main memory + load speed. It would  be much better if Unity compressed assets as it does in the webplayer or at least had the option to do so... Try building your project for webplayer and see how small it is.
Title: Re: An incredibly noob question cencerning atlases
Post by: DannyB on July 23, 2013, 10:24:56 pm
This would be awesome!
Assuming the memory consumption does not increase too much.
Loading time, I can sacrifice.

Voted in Trello.
Title: Re: An incredibly noob question cencerning atlases
Post by: TekuStudios on July 24, 2013, 11:51:04 am
I couldn't build it for web, Unity threw me some errors. However, I've built it for Windows with just one level, and the Data folder is 200Mb. Just one unfinished level!

Anyway, when we reach the final stages of development, we'll try then some solutions for this.
Title: Re: An incredibly noob question cencerning atlases
Post by: unikronsoftware on July 24, 2013, 12:01:25 pm
Another option is using assetbundles - assetbundles can be compressed (AFAIK), and you can build one asset bundle per scene. Check out BuildStreamedSceneAssetBundle