Hello Guest

Author Topic: 2 Questions about PowerOfTwo and spite scaling  (Read 5058 times)

TTkJonas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
2 Questions about PowerOfTwo and spite scaling
« on: August 21, 2012, 03:49:06 pm »
Hi,

I have two little questions.
Are there performance differences, if I use Textures with a resolution "Power of two" (256,512...), or not, because of Atlas creation from 2dtoolkit?

And are there differences if I scale my 2dSprites by using the Transform.scale parameter in the inspector, or the Scale Parameter from 2d Toolkit?

sorry for bad english and if this was already asked before. I have no answer found in the forum ;-)

lg Jonas

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2 Questions about PowerOfTwo and spite scaling
« Reply #1 on: August 21, 2012, 08:03:24 pm »
I'm not sure about performance differences with PO2 textures - I tend to use PO2 textures generally, and I use PVRTC as often as possible. PVRTC only works with PO2 textures - and they have to be square too (i.e. 256x256).

There is a difference scaling using Transform.localScale vs sprite.scale. When you use transform.localScale, dynamic sprite batching tends to  stop working (there are rules to follow to avoid it breaking, but in general avoid it as much as possible). The sprite.scale parameter will actually regenerate the sprite geometry at the larger size - while this takes a bit more CPU up-front, it doesn't stop dynamic batching from working, and as such tends to be a performance win. The general advice is - prefer sprite.scale over transform.localScale.

TTkJonas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: 2 Questions about PowerOfTwo and spite scaling
« Reply #2 on: August 22, 2012, 10:08:53 am »
Hi Unikron!

Thanks for your fast answer. :-)
So far I use the "Compressed" texture flag in the Settings Tab from the SpriteCollections. Is it also recommended to set the source file to compression PVRTC?



Thanks :-)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2 Questions about PowerOfTwo and spite scaling
« Reply #3 on: August 22, 2012, 07:56:44 pm »
You don't have to change it on the source images.