Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: agp12 on December 17, 2012, 08:30:18 PM

Title: How to make Custom Clipping in NGUI
Post by: agp12 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
Title: Re: How to make Custom Clipping in NGUI
Post by: nah0y 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.
Title: Re: How to make Custom Clipping in NGUI
Post by: agp12 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?
Title: Re: How to make Custom Clipping in NGUI
Post by: nah0y 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 :)