Hello Guest

Author Topic: Sprite Rotating in Atlas  (Read 3433 times)

dariuslol

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Sprite Rotating in Atlas
« on: May 08, 2013, 06:38:20 am »
Hi,

I've made a customized blur shader for my sprites, and I would like to independently control how much my sprites get blurred, horizontally and vertically.
In a standard texture, this is easy, but in the atlas, due to sprite rotating to better fit in, in some sprites my shader gets confused and blurs the Y axis thinking it's the X axis and vice-versa.
Is there a way around this?

dariuslol

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sprite Rotating in Atlas
« Reply #1 on: May 08, 2013, 07:02:10 am »
Oh, I've solved it myself.
Just created a new shader with the XY values swapped and applied it to the sprites that were inverted.
Do you guys know if there's a better way? I don't know if there's a huge impact in using multiple materials in an atlas.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Rotating in Atlas
« Reply #2 on: May 08, 2013, 09:33:59 am »
Multiple materials in an atlas will cost draw calls when you mix them. Its no difference to having them in separate atlases, except you get to put them all in the same texture.

dariuslol

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sprite Rotating in Atlas
« Reply #3 on: May 09, 2013, 01:52:22 am »
Ok, I'll stick with this solution for now, despite the extra draw calls.
Thanks for the reply!