Author Topic: UITexture and Movie texture - Hard clip panel  (Read 16380 times)

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
UITexture and Movie texture - Hard clip panel
« on: January 02, 2013, 03:06:40 PM »
Hi everybody,
I'd like to use a list of movie texture, using NGUI.
An UITexture is totally able to show a MovieTexture from Unity, but I need to display them into a list with some hard clipping.
If I change the shader of the UITexture from Unlit/Texture to Unlit - Transparent Colored (HardClip), and put it into a grid and a draggable UIPanel the movie texture is not displayed into the entire UITexture, but only a part of it. Plus the UITexture will disappear if while I'm scrolling them I stop moving the list (a bit hard to explain....).
I added some screenshots attached to this topic.
I vote for the HardClip shader and MovieTexture, which are not compatible.

How can I fix that? Thank you and happy new year :)


cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #1 on: January 02, 2013, 03:15:44 PM »
Okay, If I let the default UITexture shader, the Unlit/Texture, the MovieTexture is displayed correctly into the UIPanel, but the HardClipping is not working anymore.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #2 on: January 02, 2013, 03:25:14 PM »
First off, use AlphaClipping instead of HardClipping. HardClip is straight up not compatible with certain Android phones.

MovieTexture == Rendertexture? I'm not sure what's going on with the scrolling though. Are you using the newest version?

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #3 on: January 02, 2013, 03:32:25 PM »
Thanks for answering :)
The target is not a mobile platform, only standalone mac.

What's the difference between AlphaClip and HardClip ? I though the AlphaClipping used the alpha channel to calculate the fade off (only my guessing), am I wrong?
And I'm using the V2.2.6 C version of NGUI (the last one on my asset store).

And yes, I suppose that the MovieTexture is a RenderTexture, I'll test if I get the same thing with a render texture an another camera.
« Last Edit: January 02, 2013, 03:34:00 PM by cayou »

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #4 on: January 02, 2013, 04:29:09 PM »
Its seems working with a RenderTexture, with AlphaClipping.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #5 on: January 02, 2013, 04:40:55 PM »
I can fix the problem of the movie texture size by changing UV Rectangle W and H parameters (ike 0.56 for W and 0.62 for H...). But this not resolves the blinking thing when I'm scrolling the list.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #6 on: January 07, 2013, 10:10:52 AM »
Up !
 8)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #7 on: January 07, 2013, 12:20:52 PM »
Make sure that the scales of all game objects leading up to your UITexture is (1, 1, 1) (UIRoot excluded). Non-uniform scaling breaks clipping.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #8 on: January 07, 2013, 01:41:09 PM »
I checked, seems everything has scale of 1 (except UI Root).

I created a webplayer to show the problem, try to drag the movie texture, you'll see the second UITexture blinking when you stop moving while dragging.
As I said I can resolve the problem that the movie texture is not entirely displayed into the UITexture by changing UV parameters.

Edit: better with the link :)
http://cayou-prod.com/unity/clippingTest/clippingTest.html

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #9 on: January 07, 2013, 03:41:18 PM »
Why is your clipped area moving is my question? I drag left, the stuff scrolls left, but the clipped area also moves right. You got it configured oddly.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #10 on: January 07, 2013, 03:44:24 PM »
Oh yes you're right, I didn't notice that.
I'll take a look, but I just started a new project, with the latest version of NGUI.
I created a UIPanel, attached UIDraggablePanel, added AlphaClip, and put two UITexture as child.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #11 on: January 07, 2013, 03:59:20 PM »
The reason of the clip panel is moving is caused by the movie texture. But the truth is that the clipping panel is not moving, only the movie texture view (??).
I updated my example (clean your browser cache) by adding same UITexture, same shader but filled with basic textures.
You can see another bug where the last MovieTexture is displayed out of the clipping view, and not displayed when it comes to the clipping view.

 :-\

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #12 on: January 21, 2013, 04:55:37 PM »
Up !
I still didn't found a solution to this issue.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #13 on: January 28, 2013, 03:01:06 PM »
Up (again) !
This issue is easy to reproduce, create a list of UITexture, into a clipped panel (hard, alpha, doesn't matter). And one of the UITexture is a movie texture. Check if it works.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture and Movie texture - Hard clip panel
« Reply #14 on: January 28, 2013, 09:08:03 PM »
You can stop bumping this one. I've never used a movie texture with UITexture, and whatever is not working is within Unity, not NGUI. Perhaps the texture's dimensions change, or something else that's throwing off NGUI -- but the only way for you to know for certain is to debug it yourself.