Author Topic: Issue with "Texture Mask" clipping panel as child of "Soft" clipping panel.  (Read 6622 times)

DavidE523

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
I have a scroll view that uses soft clipping. The elements held in this scroll view contain a sprite that is clipped via a texture masked parent panel. They render in an unexpected way, as shown in the attached image. The character icon is parented to the same object as the background circle and has the same depth, but is not clipped in the same way. It only gets hidden once the whole sprite is out of the parent panel's bounds. Am I doing something wrong? Happy to provide more explanation/images if necessary.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
NGUI's clipping is done using shaders. NGUI provides shaders that do basic clipping (Unlit - Transparent Colored #, where # is the number of clipped panels). This shader won't combine with the shader used to clip panels via textures (Unlit - Transparent Colored (TextureClip)). They're different approaches to clipping.

In your case the best approach to take would be to create custom render textures for your previews -- you are already using what seem to be render textures, but for some reason you are using a texture-based panel clipping to create the circle around them... why not just create a render texture that already has the circle as a part of it? Then you don't need the extra panels, and the built-in default NGUI shader (Unlit - Transparent Colored) can be used to have everything get clipped nicely.

DavidE523

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Hi Aren, thanks for the reply. That clears things up, cheers! I can achieve the effect I was hoping for by simply layering different assets, the use of a texture mask clipping panel was just an attempted short cut without editing the assets.