Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: keysosaurus on September 30, 2013, 12:25:40 PM

Title: Masking with Ngui 3.0
Post by: keysosaurus on September 30, 2013, 12:25:40 PM
Hi, thanks for NGUI btw, it's a fantastic piece of software!   :D

I'm trying to render 2d characters and I want to make a mask so that their eyes look like they are inside their heads.

I have 3 images: an eye, a pupil and an eye mask.

(http://)

The eye mask is rendered invisibly on top and needs to hide the pupil, but not the eye.

Is there a shader or something I'm missing that will get it to work correctly?
I got it working in the old ngui using a render queue hack but I cant seem to get it working in 3.0

Any help would be much appreciated!  :)

Cheers,

Keysosaurus
Title: Re: Masking with Ngui 3.0
Post by: Nicki on September 30, 2013, 02:39:15 PM
http://nickithansen.dk/masking-and-clipping-textures-using-shaders-in-ngui/
Title: Re: Masking with Ngui 3.0
Post by: keysosaurus on October 03, 2013, 09:50:48 AM
Brilliant, thanks!

Works very well on the alpha now but having trouble animating the pupils.

I want to keep the alpha texture in the same location but change the position of the pupil texture independently, so that they can look around.
Trying to mess with the texture UVs in the shader but can't seem to get it working.

Any advice???

Thanks again!
Title: Re: Masking with Ngui 3.0
Post by: keysosaurus on October 03, 2013, 10:18:29 AM
Forgot to mention:

When I change the "UV Rectangle" on UITexture, it moves both textures, ie. the whole material.
When I change the offset of the textures on the material directly, nothing happens.

Any help would be much appreciated,

Cheers!