Author Topic: Masking with Ngui 3.0  (Read 16066 times)

keysosaurus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 13
    • View Profile
Masking with Ngui 3.0
« 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.



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

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile

keysosaurus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Masking with Ngui 3.0
« Reply #2 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!

keysosaurus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Masking with Ngui 3.0
« Reply #3 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!