Hello Guest

Author Topic: Platform specific atlas optimizations  (Read 3344 times)

ehudros

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Platform specific atlas optimizations
« 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! :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Platform specific atlas optimizations
« Reply #1 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.

ehudros

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Platform specific atlas optimizations
« Reply #2 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.