Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kurozael on November 21, 2013, 08:34:07 AM

Title: Sprites randomly flashing on 3.0.6 Android
Post by: kurozael on November 21, 2013, 08:34:07 AM
With Android using NGUI 3.0.6. my sprites now randomly flash. I dunno why this is, I wonder if it could be something to do with how alpha is handled now.
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: kurozael on November 21, 2013, 10:52:56 AM
Went back to 3.0.5. and everything is fine, odd.
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: ArenMook on November 21, 2013, 01:37:16 PM
Randomly flash? You can change the alpha handling back to how it was by making UIPanel.finalAlpha just return mAlpha.
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: amassingham on November 21, 2013, 08:20:31 PM
Hello,
Experiencing the same problem here - on both Android and iOS Devices.

It looks to be associated by calling NGUITools.setActive() on a GameObject/Sprite.  Toggling between true/false causes the entire panel to refresh/flash.  Might have something to do with the setDirty stuff that got added recently ?
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: zincoontrin on November 22, 2013, 12:45:18 AM
Hi,

Same here. I upgraded to 3.0.6 yesterday. This happens only on iOS/Android, not on the PC, and it seems related to gameObject.SetActive().

I can't go back to 3.0.5 because there's another bug in that version affecting us.

We have an important milestone and this bug is keeping me awake at night, almost 7:00am here :). Any possible solution?

Thanks
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: zincoontrin on November 22, 2013, 02:08:26 AM
After further investigation, I'm not so sure right now that it's related to gameobject.SetActive().

ArenMook, do you roughly know what is this bug? I mean, should I continue investigating it?

Thanks
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: ArenMook on November 22, 2013, 03:06:50 AM
I haven't seen it yet, I've been focusing mainly on improving documentation and polishing things in the last 24 hours. Feel free to add me on skype (arenmook) and I can assist in your investigations.

P.S. Although I have to say... updating to a beta at the last minute is a risky venture.
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: ArenMook on November 22, 2013, 04:20:16 AM
I am guessing it's something to do with the following part of code in the UIDrawCall:
  1.                                 if (trim || verts.buffer.Length > 65000)
  2.                                 {
  3.                                         mesh.vertices = verts.ToArray();
  4.                                         mesh.uv = uvs.ToArray();
  5.                                         mesh.colors32 = cols.ToArray();
  6.  
  7.                                         if (norms != null) mesh.normals = norms.ToArray();
  8.                                         if (tans != null) mesh.tangents = tans.ToArray();
  9.                                 }
  10.                                 else
  11.                                 {
  12.                                         mesh.vertices = verts.buffer;
  13.                                         mesh.uv = uvs.buffer;
  14.                                         mesh.colors32 = cols.buffer;
  15.  
  16.                                         if (norms != null) mesh.normals = norms.buffer;
  17.                                         if (tans != null) mesh.tangents = tans.buffer;
  18.                                 }
Replace it with what it was before:
  1.                                         mesh.vertices = verts.ToArray();
  2.                                         mesh.uv = uvs.ToArray();
  3.                                         mesh.colors32 = cols.ToArray();
  4.  
  5.                                         if (norms != null) mesh.normals = norms.ToArray();
  6.                                         if (tans != null) mesh.tangents = tans.ToArray();
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: ArenMook on November 22, 2013, 04:56:00 AM
I flat out got rid of the old double-buffering logic in UIDrawCall, since that's what it seems to have been really caused by. Grab the latest, if this issue re-occurs, please let me know.
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: zincoontrin on November 22, 2013, 05:13:29 AM
 ArenMook,

Thank you for your interest!!

I've gone back to 3.0.5 and live with the "repositioning bug" -as I call it- for the moment. That bug seemed to be solved in 3.0.6.
When I have a little more time during this weekend, I'd like to try to go back to 3.0.6 and test this UIDrawCall fix.

Thanks
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: waka1.0 on November 28, 2013, 09:44:55 AM
Hi,

I also have the phenomenon of randomly disappearing and reappearing sprites here, but on PC with Version 3.06f5.
The behaviour occurs when activating/deactivating panels or the parenting GameObjects.
(the same with enable/disable - suddenly different parts of the UI are missing)

In Version 3.05 everything worked fine.

As I am fairly new to ngui, any help would be appreciated :-)
Thanks!
Title: Re: Sprites randomly flashing on 3.0.6 Android
Post by: ArenMook on November 28, 2013, 02:35:24 PM
It might be related to another issue I investigated and fixed earlier today. I will push f6 shortly.