Author Topic: How to make Custom Clipping in NGUI  (Read 3778 times)

agp12

  • Guest
How to make Custom Clipping in NGUI
« on: December 17, 2012, 08:30:18 PM »
In Unity, especially in UIPanel, there is a feature to do clipping (Hard clipping, soft clipping, and alpha clipping). But all of them are based on rectangular shape. So the bound is rectangle. What I want is to make clipping with bound/shape polygon. Can I achieve that? I thought I have to write my custom shader, but unfortunately I am a newbie in Unity. So can someone give me a hint the logical step of those steps? I dont know where to start.

I attached the effect clip I want.
The left, is without clipping. And the right is with clipping. The star is a parent which has some clipping shader. And the child inside it will be clipped with the parent's bound.

Thank you

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: How to make Custom Clipping in NGUI
« Reply #1 on: December 18, 2012, 04:59:16 AM »
Hi,

I needed the same thing, but unfortunately it's not supported by NGUI, you have to use a custom shader of your own.

agp12

  • Guest
Re: How to make Custom Clipping in NGUI
« Reply #2 on: December 19, 2012, 02:10:33 AM »
Hi,

I needed the same thing, but unfortunately it's not supported by NGUI, you have to use a custom shader of your own.

Did you happen know how to make custom shader ? Maybe you can share some points or any good tutorial about that?

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: How to make Custom Clipping in NGUI
« Reply #3 on: December 19, 2012, 03:53:08 AM »
Hello,

Nop sorry didn't make it, maybe later when we'll have time to work on that!

Good luck :)