Wednesday, 30 April 2014

ATF experiments in Adobe AIR (in Android)



A MORE UP TO DATE VERSION OF THIS POST CAN BE FOUND HERE:

--- WE RECOMMEND YOU TO VISIT THE LINK ABOVE ---



After we developed out latest app PerfectBrew for Android (helps you making teas!)
We realized it takes ages to load (well... 10 seconds!) but we want it faster. We had one unique texture atlas with PNG (2048x2048), fully crowded with everything....
 
In order to be able to expand our app later on we have decided to split it in 3 atlases (same contents for now)
  • 1 PNG (1024x2048)
  • 1 PNG (1024x1024)
  • 1 ATF (1024x2048)
We wanted to make sure we use ATF as much as possible without breaking the graphics (as it doesnt support preMultiplied Atlas!)

We compressed out PNG to ATF with:
png2atf.exe -c e -e -q 10 -4

And here are the results:

1 big PNG:
Loading time: 9-10 seconds.
VRAM used (right after loading) 3 PNGS: 31Mb

3 PNGs:
Loading time: 9-10 seconds.
VRAM used (right after loading) 3 PNGS: 37Mb

2 PNGs + 1 ATF:
Loading time: 8-9 seconds. 
VRAM used (right after loading) 2 PNGS + 1 ATF: 29Mb

We couldn't speed up the load unless we had some textures loaded AFTER the app started. But this was just an experiment where we forced the program to load everything at start.

We used ATFs in Beekyr (a ton of textures there!) and it was a lot more noticeable as there are a lot of ATFs in the game.

I hope this can be useful for somebody!

No comments:

Post a Comment