Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: cayou on January 18, 2013, 01:16:47 PM
-
Hi everybody,
I was wondering if it could be possible to create a circular clipping view (only by Hard/Alpha clipping, not soft) rather than a rectangle one.
This could be great !!
Thanks,
Loic.
-
You could do this by using a texture instead of specifying a matrix like NGUI does. It involves writing your own shaders, however.
-
I managed to solve this using depthmask and circular mesh, kinda dirty but it works...
Thank you anyway !
-
could you share your solution?
-
I'm using this shader:
http://wiki.unity3d.com/index.php/DepthMask (http://wiki.unity3d.com/index.php/DepthMask)
And I apply it to a circle mesh. This mesh is a square place with an circular hole on it. It could be any different shape, like a star for example.
If you combine it with a UIPanel hard clipping (same size as the mesh square), it will give you the illusion of circular hard clipping.
Of course it doen't work with soft clipping, cause of the shader (display pixel or not, 0 or 1).