Hello Guest

Author Topic: Problem with Static Sprite Batcher on Windows Phone 8  (Read 3846 times)

stiv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Problem with Static Sprite Batcher on Windows Phone 8
« on: July 26, 2013, 03:22:10 pm »
Hi,

I've just tried running my project on a WP8 device for the first time and discovered that all my StaticSpriteBatchers do not display (there is just nothing there). If I click "Edit" on the SSB to bring all the objects underneath back and then run it again everything displays ok (but obviously not batched).

The problem seems isolated to the WP8 device, in the emulator everything appears correctly.

I am using Unity 4.2.0f4 on Win8 and 2D Toolkit v2.0 Final + Hotfix 2

Any suggestions would be really appreciated. Happy to provide more info I'm just not sure what is useful.

Cheers,
Steve

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9707
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #1 on: July 26, 2013, 03:26:38 pm »
We've managed to repro, but not got to the bottom of this. The debugger is hopeless - it just lies about values all the time making it useless to work out whats going wrong. Debugging with prints takes a long time.

Edit: There is no ETA for a fix yet.

stiv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #2 on: July 27, 2013, 07:41:29 am »
Thanks for looking into it, I'm kinda happy that it isn't just me.

I guess I'll just stop using them until a fix is available.

Cheers

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9707
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #3 on: July 27, 2013, 11:00:40 am »
Well you could use it, but leave it in the non-committed state. That will cover you for now.

cesarpo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #4 on: August 17, 2013, 05:30:05 am »
Is there any fix for this? Besides leaving the batcher uncommited.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9707
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #5 on: August 17, 2013, 12:39:29 pm »
Not yet. I'm waiting for them to improve the debugger stuff slightly - already spent half a day on this and without a proper debugger (it currently just lies about stuff) it will take absolutely AGES to debug. Theres a new version out soon - hopefully they fix it then?

kdimas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #6 on: October 04, 2013, 11:00:20 pm »
Hi, have you figure out this issue? I can confirm that issue persists in v 2.20 final + hotfix 0.

Not committing the batch seems to be a temporary solution, but it is significantly impacting draw calls.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9707
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #7 on: October 05, 2013, 12:27:58 pm »
There is one workaround, but I'd rather not suggest that at the moment. I'm investigating this again - hopefully debugging works this time round and I'll get further...

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9707
    • View Profile
Re: Problem with Static Sprite Batcher on Windows Phone 8
« Reply #8 on: October 08, 2013, 03:27:23 pm »
After investigating this we've found that the issue is caused by a really nasty bug in Unity. It seems to be present on WP8 builds in 4.2.x, and we've filed a bug report with them (#568206 if you need to help convince them to fix it quicker).

This also affects Windows Store Apps.

In tk2dStaticSpriteBatcher.Awake, add the following lines:

   void Awake()
   {
#if UNITY_WP8 || UNITY_METRO
  if (!Application.isEditor)
  {
   foreach (var bs in batchedSprites)
   {
    bs.relativeMatrix = bs.relativeMatrix.transpose;
   }
  }
#endif
      Build();
   }

Due to the nature of the Unity bug, we can't release a proper bug fix. We'll add a Debug.LogError when building on Windows Phone 8 linking to this forum thread so people are aware of it until Unity fix it properly.
« Last Edit: October 08, 2013, 03:39:29 pm by unikronsoftware »