Avatarchik / UIMask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIMask

Reverse Mask of Unity "Mask" component. mask_test

How to use:

  1. Download shaders from the provided link

  2. Put them into your project (anywhere would do, but keep in mind your own project hierarchy)

  3. Notice that there are two shaders (UIMask and UIMasked). You need to create two materials (i.e. ReverseMask and ReverseMasked).

  4. Create a new material (ReverseMask) and under "Shader" drop-down menu, select "IndieYP->UIMask". As it's texture, put the texture that you want to be the mask (in my case it was a circle, because I wanted the make a "hole" in the black background).

  5. Create a new material (ReverseMaked) and under "Shader" drop-down menu, select "IndieYP->UIMasked". Set the color of you material (in my case, black).

  6. Now you need to assign the materials to your game objects. ReverseMasked goes to the game object that you want to mask (in my case, panel that's serving as a background). ReverseMask goes to game object that's going to do the masking, in my case, image that's set as a child of the mentioned panel (this is very important).

Also, set the same texture (that you used for ReverseMask) as a source image for Image game object.

About


Languages

Language:GLSL 100.0%