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

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
3.0.6f6 - UITexture drawcall not rendering correct texture
« on: November 29, 2013, 09:11:17 AM »
I have a strange problem. When I have several UITexture widgets and assign different textures to all widgets it sometimes happen that all UITextures draw one and the same texture, even so the correct textures are assigned.

All UITexture widgets have the same UIPanel as parent.

This behaviour is reproducable with 3.0.6f3 (haven't checked an earlier version).

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 #1 on: November 29, 2013, 09:15:10 AM »
Can't say I've seen this one. If you really are using f6 and not f3, can you create a repro case for me to look at?

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #2 on: November 29, 2013, 09:30:37 AM »
Ok, I see what I can do. For now I have to find a fast workaround to get the update shipped this evening. I'll keep you informed.

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #3 on: November 29, 2013, 09:34:29 AM »
The difference to an UITexture implementation from 2.6xx is, that when assigning another mainTexture, the panel gets removed and created in one step..

  1. if (mPanel != null && mMat != null) mPanel.RemoveWidget(this);
  2. .
  3. .
  4. .
  5. if (enabled) CreatePanel();

windsky527

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 11
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #4 on: November 30, 2013, 03:54:32 AM »
I have the same problem as you describ.the texture had set a right value,and I can preview the  right texture ,but it is render wrong ! and the texture  sometime will flicker when the panel is refresh ..the version is 3.0.6f6

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 #5 on: November 30, 2013, 04:53:49 PM »
I still need a case to reproduce it.
  1. if (mPanel != null && mMat != null) mPanel.RemoveWidget(this);
The line above is not found anywhere in the project.

windsky527

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 11
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #6 on: December 01, 2013, 09:27:28 PM »
I think he just want to say that code has delete in the new version ,so the texture is render wrong.
I have branch my project and test again,I found when I just set the value to the static UITexture so I can get a right result,but when I add a tween effect to the game object  they will show the same picture,the object who contain a texture first active is false, and the effect let it from hidden to show....
« Last Edit: December 01, 2013, 11:00:50 PM by windsky527 »

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #7 on: December 02, 2013, 01:10:58 AM »
I'm having this issue also on the last version of ngui, where the texture doesn't display correctly, When I change dynamically the texture in some cases it displays correctly, and on other just change the texture internally, but the image is not displayed correctly, but if I deactivate the texture and active it again on the editor it updates the it displays correctly the image.

kurozael

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #8 on: December 02, 2013, 07:13:58 AM »
I am also encountering this issue.

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 #9 on: December 02, 2013, 08:57:32 AM »
Try changing UITexture.mainTexture to the following:
  1.         public override Texture mainTexture
  2.         {
  3.                 get
  4.                 {
  5.                         return mTexture;
  6.                 }
  7.                 set
  8.                 {
  9.                         if (mTexture != value)
  10.                         {
  11.                                 RemoveFromPanel();
  12.                                 mTexture = value;
  13.                                 MarkAsChanged();
  14.                         }
  15.                 }
  16.         }

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #10 on: December 02, 2013, 11:44:11 AM »
Nope, didn't work. I've tried to create a repo case but can't reproduce it in a small Unity project  :(

windsky527

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 11
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #11 on: December 02, 2013, 10:56:22 PM »
I have made a small case to show this issue;
I post two c# script, one is TestUITexture.CS attach at the panel
and you must creat 5 texture, and let they in a row, then creat a sprite attach a collider
then the code will set the texture's value at your Resources folder..

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #12 on: December 03, 2013, 04:17:54 AM »
Sounds like you alread have a test project. Can you post this?

windsky527

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 11
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #13 on: December 03, 2013, 05:01:15 AM »
I have post the main code,you just need creat a new scene and add five textures at the default panel,and let them grid in a row for the effect,attach the two code to the panel (you must creat a local folder of Resources and put some pictures in it). then you will reproduce it.

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Re: 3.0.6f6 - UITexture drawcall not rendering correct texture
« Reply #14 on: December 03, 2013, 03:06:41 PM »
I send you ArenMook a pm, with a project example of the problem. Hope that helps to find the problem.