Hello Guest

Author Topic: Sprites from a particular atlas render incorrectly  (Read 3864 times)

Daniel_S_GP

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprites from a particular atlas render incorrectly
« on: April 21, 2014, 03:57:15 pm »
Hello, I am fairly new to 2D Toolkit, so forgive me if this issue is something simple/trivial.

So in one of the game's scenes, a particular atlas is causing problems where any sprite that uses that atlas appears 'glitched'. Instead of displaying the intended sprite it displays random bits and pieces of the atlas. Some parts of other sprites are seen and there is heavy repetition for sprites that are large. The bits and pieces that are displayed do not change if the scene is re-loaded. This leads me to believe that the UV's are either offset or have been corrupted somehow. However, I can't be certain as I don't know how TK2D works under the hood.

The real meat of the problem is that this does not happen in the editor, but only happens on Android devices (iOS works fine). I've read something on another thread about how having null sprites in a collection can cause problems. Indeed there were some sprites in the collection that referenced nothing. I promptly deleted them & committed. However, this only fixed the issue on some Android devices. The newer ones like the Galaxy S4 and the Nexus 7 are still displaying that particular scene improperly (the rest of the game appears fine). Given that this happens on newer Android devices and not on older ones (and not on iOS), I figure that this is a more a 'lower level' issue.

Some things I've tried: re-building the index, checking integrity, reverting back using version control, deleting null sprites from both the same sprite collection and other sprite collections.

Update: After closer examination, some sprites display the intended section of the atlas while others still display random bits and pieces. I guess this just makes this more confusing as only some sprites screw up in the collection while others are fine. The sprites don't screw up in any particular order. There are some that work, and some that don't.

Does anybody have any idea why this would be happening?
« Last Edit: April 21, 2014, 10:56:39 pm by Daniel_S_GP »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites from a particular atlas render incorrectly
« Reply #1 on: April 22, 2014, 03:11:57 pm »
What are the texture dimensions on this sprite collection? Maybe the texture itself is incorrect on that platform?
The best way to test this is to drag the atlas material onto a unity plane, and deploy this single scene to the android device where it breaks. The images should look identical, otherwise the texture itself is broken and you'll need to identify why.

Daniel_S_GP

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprites from a particular atlas render incorrectly
« Reply #2 on: April 22, 2014, 06:25:56 pm »
It turns out that upgrading TK2D to version 2.4 seems to have fixed the issue. Don't really know why I didn't try that earlier.

Thank you for the help nonetheless.