-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use ATF (wiki request) #92
Comments
There's one other minor step: you need to change a couple things in the library.json. This is the (mac bash) script I use to convert my UI Flump archive:
As you can see on the "cat library.json..." line, I'm adding a textureFormat property to the top level object in the json, and replacing all references of .png to .atf. That's all that's required to get ATF working in a flump zip. The additional thing I do here is the TexturePacker bit. The important bit there is the --reduce-border-artifacts. The rest of it is just to keep it from mangling the image dimensions or orientation in any way. The border artifacts thing helps an atlas with components that have transparent edges from ending up with a black halo effect at runtime, which was noticeable in some of my flump usage. The black halo is caused by a difference in how Bitmap textures vs ATF textures are used in the Stage3D runtime, specifically premultiplied alpha. More info on that particular problem: http://www.pixelenvision.com/3273/texture-packer-the-tool-that-stands-the-test-of-time/. At any rate, you might not see a problem in your own project, or you might decide it's not bad enough to spring for the $40 TexturePacker license. I suppose it wouldn't take much to make this into a wiki article, but I'm just going to leave it here for now. Hopefully that answers your questions. Feel free to drop any more relating to ATF in here, I'm pretty well versed with it at this point. |
Whoops, didn't mean to close it prematurely. Reopening in case there are more questions. |
Oh one other note: My UI was getting visible artifacts with the default JPEG XHR compression used by png2atf, which is why I went with -q 0. That means that the resulting .zip is actually larger than the .png version exported by Flump. It does load faster though, and it produces less junk during the library texture upload phase, which is important for my mobile project. I recommend just playing around with the -q setting to see what looks good for your project. |
Good news from my side: TexturePacker 3.5.0 now supports writing ATF directly. No need to use png2atf anymore. And you can also set the quality for PVRTC, ETC1 and DXT.... |
Anyone willing to write up how to use ATF textures and add it to the wiki.
Is it as simple as unzipping, running the atf conversion, replacing .png atlases with .atf, then zip it all back up? Do i need to reference the file extension of the atlas in the json file as well? Anything else I am missing?
The text was updated successfully, but these errors were encountered: