2D Toolkit Forum

2D Toolkit => Support => Topic started by: ehudros on April 08, 2014, 10:16:39 am

Title: Platform specific atlas optimizations
Post by: ehudros on April 08, 2014, 10:16:39 am
Hi,
We're using multiple platforms in our sprite collections and it seems like 2d toolkit can do a better job optimizing them.
Currently, if you have a 4x sprite collection that requires two atlas textures (due to the 2048 size limit), the 2x and 1x platforms will also use more than one atlas texture although they can actually fit all sprites in just one atlas.
This can end up saving draw calls as in 2x and 1x platforms less atlases are required.

Is there any way to hack tk2dSpriteCollecitonPlatformBuilder to work this way?

Thanks! :)
Title: Re: Platform specific atlas optimizations
Post by: unikronsoftware on April 08, 2014, 11:36:24 am
Look for "// Update atlas sizes" in that file. Thats where all the max texture sizes are set. You can change it so it doesn't scale the max sizes by platform.
Title: Re: Platform specific atlas optimizations
Post by: ehudros on April 08, 2014, 11:54:48 am
Awesome, commenting out line 116 (proxy.maxTextureSize = (int)(proxy.maxTextureSize * scale)) did the trick.
I think it's worth adding this is as default in 2dtk, or at least allowing users to do this through the sprite collection editor as the performance gains may be significant.