Author Topic: 3.0.6f6 - UITexture drawcall not rendering correct texture  (Read 8752 times)

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #15 on: December 03, 2013, 03:52:59 PM »
Thumbs up!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #16 on: December 03, 2013, 06:12:46 PM »
Got the repro case, will fix it tonight. Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #17 on: December 03, 2013, 09:32:13 PM »
Alright, here's the fix. Replace UIPanel.InsertWidget function with this:
  1.         static public UIDrawCall InsertWidget (UIWidget w)
  2.         {
  3.                 UIPanel p = w.panel;
  4.                 if (p == null) return null;
  5.                 Material mat = w.material;
  6.                 Texture tex = w.mainTexture;
  7.                 int depth = w.raycastDepth;
  8.                 BetterList<UIDrawCall> dcs = UIDrawCall.activeList;
  9.  
  10.                 for (int i = 0; i < dcs.size; ++i)
  11.                 {
  12.                         UIDrawCall dc = dcs.buffer[i];
  13.                         if (dc.manager != p) continue;
  14.                         int dcStart = (i == 0) ? int.MinValue : dcs.buffer[i-1].depthEnd + 1;
  15.                         int dcEnd = (i + 1 == dcs.size) ? int.MaxValue : dcs.buffer[i+1].depthStart - 1;
  16.                        
  17.                         if (dcStart <= depth && dcEnd >= depth)
  18.                         {
  19.                                 if (dc.baseMaterial == mat && dc.mainTexture == tex)
  20.                                 {
  21.                                         if (w.isVisible && w.hasVertices)
  22.                                         {
  23.                                                 w.drawCall = dc;
  24.                                                 dc.isDirty = true;
  25.                                                 return dc;
  26.                                         }
  27.                                 }
  28.                                 else mRebuild = true;
  29.                                 return null;
  30.                         }
  31.                 }
  32.                 mRebuild = true;
  33.                 return null;
  34.         }

windsky527

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 11
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #18 on: December 03, 2013, 10:24:13 PM »
yes.it's show right!,thanks!

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #19 on: December 04, 2013, 02:57:24 AM »
yes, it seems that the fix is working.

Thanks ArenMook