Author Topic: Problem with Texture Masking within Clipped Panels  (Read 2130 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Problem with Texture Masking within Clipped Panels
« on: October 28, 2014, 06:52:03 PM »
I'm using NGUI 3.7.5, and trying to use the new Texture Masking panel feature to mask something that moves in and out of a clipped panel. The problem that I'm having is that these seem to be mutually exclusive: The texture masked sprites won't be clipped by the panel's clipping region.

Digging through the code, this seems to be because the TextureClip shader doesn't contain alternates for more levels of clipping. Is my best bet on getting this functionality to hack in some shaders like "Transparent Colored (TextureClip) 1" that apply both the texture mask and parent panels' clipping regions, and make UIDrawCall take clipping count into account when looking at texture masked panels?


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with Texture Masking within Clipped Panels
« Reply #1 on: October 29, 2014, 05:21:51 AM »
They are indeed exclusive because they are different ways of clipping content. Creating multiple levels of rect clipping is one thing, but creating various shaders for different combinations of texture + rect clipping is another entirely. I'm not willing to clutter NGUI to do that. If you need both, create a shader that supports both -- straight and to the point. That said, I just wouldn't recommend it. Pick one and stick to it.